1. 更新 apt-get
apt-get update
2. 安装 mysql-client-core-5.7
apt-get install MySQL-client-core-5.7
3. 安装 mysql-client-5.7
apt-get install mysql-client-5.7
4. 安装 mysql-server-5.7
apt-get install mysql-server-5.7
5. 启动mysql
service mysql restart
6. 开启远程访问
1. 修改配置文件
cd /etc/mysql/mysql.config.d
vim mysqld.cnf
2. 把bind-address 改成
bind-address = 0.0.0.0:
7. 添加连接访问账号密码
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;
其中root为登录账号、youpassword为登录密码
8. 刷新权限
FLUSH PRIVILEGES
9. 重启
service mysql restart
网友评论