Centos
wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
yum localinstall -y mysql57-community-release-el7-7.noarch.rpm
yum install -y mysql-community-server
启动MySQL服务
systemctl start mysqld.service
grep 'temporary password' /var/log/mysqld.log 获取临时密码!
use mysql;
alter user 'root'@'localhost' identified by '#Chuqv9580';
flush privileges;
所有IP登录
GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'your password' WITH GRANT OPTION;
Ubuntu
wget https://repo.mysql.com//mysql-apt-config_0.8.8-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.8-1_all.deb
sudo apt-get update
sudo apt-get install mysql-server
在my.con [mysqld]的段中加上一句:
skip-grant-tables
免登录