安装 :
# 安装 Dos下 MySql 客户端访问软件
sudo apt install mysql-client-core-5.7
# 安装 MySql Server
sudo apt install mysql-server
# Dos登录MySql
mysql -u root -p [回车 root]
# 修改登录密码
use mysql;
update user set authentication_string =password('新密码') where user ='root';
# 赋权限
GRANT ALL ON *.* TO user@'%' IDENTIFIED BY '新密码' WITH GRANT OPTION;
flush privileges;
# 修改MySql的IP绑定地址
sudo vim /etc/mysql/mysql.conf.d/mysql.cnf
注释 bind-address = 127.0.0.1
# 重启MySql
/etc/init.d/mysql restart
# 登录MySql
mysql -h 192.168.1.123 -u root -p [回车写入root新密码]