天天看点

centos6.9 rpm方式 安装 mysql 5.6.40

1.http://mirrors.sohu.com/mysql/MySQL-5.6/下载 到/home

MySQL-client-5.6.40-1.el6.x86_64.rpm

MySQL-devel-5.6.40-1.el6.x86_64.rpm

MySQL-shared-5.6.40-1.el6.x86_64.rpm

MySQL-server-5.6.40-1.el6.x86_64.rpm

2.# rpm -qa|grep mysql 

mysql-libs-5.1.73-7.el6.x86_64 #<=卸载自带的mysql依赖包

# rpm -e mysql-libs-5.1.73-7.el6.x86_64 --nodeps

3.# rmp -ivh MySQL-client-5.6.40-1.el6.x86_64.rpm #<=安装4个rpm包

# rmp -ivh MySQL-devel-5.6.40-1.el6.x86_64.rpm

# rmp -ivh MySQL-shared-5.6.40-1.el6.x86_64.rpm

# rmp -ivh MySQL-server-5.6.40-1.el6.x86_64.rpm

4. 安装完 最后一个rpm 提示如下

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !

You will find that password in '/root/.mysql_secret'.

You must change that password on your first connect,

no other statement but 'SET PASSWORD' will be accepted.

See the manual for the semantics of the 'password expired' flag.

5.# shutdown -r now #<=重启

6.# service mysql status #<=mysql自动启动了

7.# mysql -u root -p 

password: 此处输入 '/root/.mysql_secret'. 中的初始随机密码 进入mysql

8.mysql>SET PASSWORD = PASSWORD('123456');

9.完成安装

10.开放互联网环境访问接入 update user set host = '%' where user = 'root'

11.如果是服务器请添加开放3306 安全策略配置

继续阅读