mysql安装
#搜索安装包
apt-cache search mysql-server-5.7
#安装5.7版本
apt-get install mysql-server-5.7 -y
#检测
netstat -antp |grep mysql
root登录
#root初始密码为空
mysql -uroot -p
修改root密码和赋权
grant all privileges on *.* to 'root'@'%' identified by '密码' with grant option;
flush privileges;
修改配置文件
vim /etc/mysql/mysql.conf.d/mysqld.cnf
#注释
bind-address = 127.0.0.1
#重启
service mysql restart