下载安装包
由于官网访问及版本选择下载不太方便,使用 suho 的源进行下载
下载如下三个安装包:
MySQL-server-5.6.24-1.el6.x86_64.rpm
MySQL-client-5.6.24-1.el6.x86_64.rpm
MySQL-devel-5.6.24-1.el6.x86_64.rpm
进行安装
如原装有mysql 请在安装前先进行卸载
[[email protected] files]# rpm -qa | grep mysql
[[email protected] files]# yum remove -y mysql-libs-5.1.66-2.el6_3.x86_64
[[email protected] files]# rm MySQL-server-5.6.24-1.el6.x86_64.rpm
...
[[email protected] files]# rpm-ivh MySQL-client-5.6.24-1.el6.x86_64.rpm
Preparing... ########################################### [100%]1:MySQL-client ########################################### [100%5.6.24-1.el6.x86_64.rpm
Preparing... ########################################### [100%]1:MySQL-devel ########################################### [100%]
启动 mysql start 启动 stop 停止 restart 重启
[[email protected] files]# service mysql start
Starting MySQL. SUCCESS!
查看是否开机启动,设置为开机启动
grep mysql
[[email protected] files]# chkconfig mysql on
开通远程权限 root 为用户 123456 为密码,防火墙需要开通3306 端口
进入mysql
>GRANT USAGE ON *.* TO [email protected]%‘ IDENTIFIED BY ‘123456‘ WITH GRANT OPTION;>FLUSH privileges;
进入出错处理:
mysqld_safe --skip-grant-tables &
mysql -uroot -p
>use mysql;
>update mysql.user set password=PASSWORD(‘123456‘) where User=‘root‘ ;
>flush privileges ;
出错:
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
>SET PASSWORD = PASSWORD(‘123456‘);
原文:http://www.cnblogs.com/cnblank/p/4410352.html