Centos安装mysql5.7

1

从官网上下载MysqL安装包MysqL-5.7.26-1.el7.x86_64.rpm-bundle.tar

2

解压文件:
tar -xvf MysqL-5.7.26-1.el7.x86_64.rpm-bundle.tar

3

本地安装 comm client libs libs-compat dev server 根据实际安装环境安装其他缺失的包
yum localinstall MysqL-community-libs-5.7.26-1.el7.x86_64.rpm MysqL-community-libs-compat-5.7.26-1.el7.x86_64.rpm MysqL-community-common-5.7.26-1.el7.x86_64.rpm MysqL-community-client-5.7.26-1.el7.x86_64.rpm MysqL-community-devel-5.7.26-1.el7.x86_64.rpm MysqL-community-server-5.7.26-1.el7.x86_64.rpm

4

初始化MysqL 
mkdir /udata/MysqL 
chown MysqL:MysqL /udata/MysqL
修改/etc/my.cnf
datadir=/udata/MysqL 如果修改了socket的位置务必[client] 加上socket 对应的位置
myqld --initialize 并查看MysqL生成随机密码 ,认位于 /var/log/MysqLd.log中

5

启动MysqL服务
    systemctl enable MysqLd
    systemctl start MysqLd

6

MysqL  -uroot -p上诉随机密码  连接到MysqL
    set password = password('xxx') 修改密码 xxx为修改后的密码

7

update user set host = '%' where host='localhost';
    flush privileges
    允许其他主机远程连接MysqL

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native