ubuntu下安装mysql(二进制)到自定义目录_MySQL

php中文网
发布: 2016-06-01 13:36:05
原创
1234人浏览过

Ubuntu

bitsCN.com

ubuntu下安装mysql(二进制)到自定义目录

 

一,安装

1, 下载 mysql二进制文件: http://dev.mysql.com/downloads/mysql/ 页面,选择linux generic ,然后选择最后一个 “Linux - Generic (glibc 2.5) (x86, 32-bit), Compressed TAR Archive” 进行下载 (32或者64根据是实际情况) 

2, 切换到root 用户 

3, 先创建一个group和一个属于这个组的user 

shell> groupadd group1 

shell> useradd -r -g group1 user1 

3,  解压下载的二进制包, 到自己要放的位置, 如home/user/mysql 

4, cd home/user/mysql 

5, 赋予操作权限: 

   chown -R user1 .  

   chgrp -R group1 . 

6, scripts/mysql_install_db --user=user1  为user1安装数据库 (需要libaio包,使用新德里帮忙下一下) 

7, 赋权限: 

   chown -R root .  

   chgrp -R group1 .  

   chown -R root .  

   chown -R user1 data 

8,启动mysql后台服务: 

  bin/mysqld_safe --user=user1 & 

如果没有报错,那么就是服务器的启动成功。 

测试一下: 

新开一个terminal, 

cd home/user/mysql/bin 

./mysqladmin version 

正确的话 就会显示版本信息之类的 并且没有其他错误报出。 

 

二,增加安全性 

cd home/user/mysql 

bin/mysql_secure_installation 

然后具体步骤的一些 信息如下: 

Enter current password for root (enter for none): 

OK, successfully used password, moving on... 

 

Setting the root password ensures that nobody can log into the MySQL 

root user without the proper authorisation. 

 

Set root password? [Y/n] y 

New password: 

Re-enter new password: 

Password updated successfully! 

171cms应用市场系统 v5.1.0源码
171cms应用市场系统 v5.1.0源码

171cms应用市场系统是国内首款针对APP应用市场而生开源的CMS,pc站+wap站+APP原生客户端三站合一,提供完整的APP应用市场搭建、运营、推广一站式解决方案。 软件介绍: 1、免费开源,自动采集功能 2、精美模板多样化,自定义模板,自定义标签 3、原生APP客户端,PC+wap多终端进行推广 安装步骤: 1、第一步,安装包解压,通过FTP上传到配置好的网站根目录下,在浏

171cms应用市场系统 v5.1.0源码 305
查看详情 171cms应用市场系统 v5.1.0源码

Reloading privilege tables.. 

... Success! 

 

By default, a MySQL installation has an anonymous user, allowing anyone 

to log into MySQL without having to have a user account created for 

them.  This is intended only for testing, and to make the installation 

go a bit smoother.  You should remove them before moving into a 

production environment. 

 

Remove anonymous users? [Y/n] y 

... Success! 

 

Normally, root should only be allowed to connect from 'localhost'.  This 

ensures that someone cannot guess at the root password from the network. 

 

Disallow root login remotely? [Y/n] y 

... Success! 

 

By default, MySQL comes with a database named 'test' that anyone can 

access.  This is also intended only for testing, and should be removed 

before moving into a production environment. 

 

Remove test database and access to it? [Y/n] y 

- Dropping test database... 

... Success! 

- Removing privileges on test database... 

... Success! 

 

Reloading the privilege tables will ensure that all changes made so far 

will take effect immediately. 

 

Reload privilege tables now? [Y/n] y 

... Success! 

 

三,便利设置

1,将mysql的路径加到环境变量中去: 

sudo gedit /etc/profile 

然后加入: 

1, export MYSQL_HOME=home/user/mysql; 

2,在PATH=XX后面加入 :$MYSQL_HOME/bin 

 

bitsCN.com
相关标签:
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号