1.更新系统 安装MySQL
sudo apt-get update
apt-get install mysql-server
Y
2.开启mysql
systemctl start mysql//开启
systemctl status mysql//查看
systemctl stop mysql //关闭
3.修改root 密码
systemctl sstart mysql
mysql -u root -p
root
mysql> use mysql //选中表
ALTER user 'root'@'localhost' IDENTIFIED BY '新密码';
create user 你的名字@'%' identified by '你的密码'; 创建外部链接用户
ALTER USER '你的名字'@'%' IDENTIFIED BY '密码' PASSWORD EXPIRE NEVER; 加密方式修改
ALTER USER '你的名字'@'%' IDENTIFIED WITH mysql_native_password BY '密码';
GRANT ALL priviliges TO 你的名字@'%' 权限给与
vi /etc/mysql/mysql.conf.d/mysqld.cnf 去除mysql配置中bind_address
#bind-address = 127.0.0.1
4.远程链接