前端之家收集整理的这篇文章主要介绍了
CentOS 6.5下二进制安装 MySQL 5.6,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
CentOS 6.5下二进制安装 MySQL 5.6
CentOS 6.5 二进制安装MysqL 5.6
1:查看系统版本
1 2 |
[root@10-4-5-9 MysqL]# cat /etc/redhat-release CentOS release 6.5 (Final) |
@H_502_29@
2:下载MysqL5.6二进制包
1 |
#wget http://cdn.MysqL.com/Downloads/MysqL-5.6/MysqL-5.6.20-linux-glibc2.5-i686.tar.gz |
@H_502_29@
3:添加用户和组
4:安装MysqL到/usr/local/MysqL下
1 2 3 4 5 6 7 |
#cd /usr/ local #tar zxvf /{MysqL5.6_path}/MysqL-{version}.tar.gz 例如我的配置路径为: #cd /usr/ local #tar zxvf /root/MysqL-5.6.20-linux-glibc2.5-i686.tar.gz |
@H_502_29@
5:修改解压后文件夹名为 MysqL
6:修改MysqL的各级文件夹和文件的创建者、创建组为MysqL(注意语句后面有个.)
7:至此MysqL已经安装完了,但还需要初始化,初始化MysqL表、test表、infomation表等。
1 |
#scripts/MysqL_install_db --user=MysqL --basedir=/usr/local/MysqL --datadir=/usr/local/MysqL/data<br><br> |
@H_502_29@
1 2 |
PS:该步骤有可能会报错误 安装需要的包即可:libstdc++.so.6和libaio.so.1和libncurses.so.5 |
@H_502_29@
8:修改配置文件
1 2 3 |
[root@10-4-5-9 MysqL]# cp my.cnf /etc/my.cnf /usr/ local /MysqL [root@10-4-5-9 MysqL]# vi /etc/my.cnf |
@H_502_29@
1 2 3 4 5 6 |
[MysqLd]中添加: basedir = /usr/ local /MysqL datadir = /usr/ local /MysqL/data port = 3306 server_id = 1 |
@H_502_29@
9:启动MysqL服务
10:登陆MysqL并且删除空用户
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
MysqL> SELECT user ,host, password FROM MysqL. user ; + ------+-----------+----------+ | user | host | password | + ------+-----------+----------+ | root | localhost | | | root | 10-4-5-9 | | | root | 127.0.0.1 | | | root | ::1 | | | | localhost | | | | 10-4-5-9 | | + ------+-----------+----------+ 6 rows in set (0.00 sec) MysqL> UPDATE MysqL. user set password = PASSWORD ( 'gechong' ) WHERE user = 'root' ; MysqL> DROP USER '' @localhost; MysqL> FLUSH PRIVILEGES ; |
@H_502_29@
求知若渴,虛心若愚……
标签: MySQL 安装卸载
原文链接:https://www.f2er.com/centos/375440.html