卸载mariadb-libs:
$sudo yum remove mariadb-libs
下载MySQL包 :
链接:https://pan.baidu.com/s/1fWOraXcWB1plUbcVjNDLDw
提取码:yk7b
安装client:
$sudo yum install MySQL-client-5.6.47-1.el7.x86_64.rpm
安装server:
$sudo yum install MySQL-server-5.6.47-1.el7.x86_64.rpm
初始化:
$sudo /usr/bin/mysql_install_db
启动server:
$ sudo service mysql start
获取root的初始密码:
$sudo cat /root/.mysql_secret
修改密码:
$mysql -u root -p
mysql> set password = password('root');
my.cnf在哪里:
$mysql --help | grep my.cnf
order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
$sudo find / -name my.cnf
按照上面步骤安装Mysql5.6后,my.cnf的文件在/usr目录下面,请将my.cnf文件copy到/etc下,再进行配置。