美文网首页
ubuntu20安装mysql8并设置远程连接

ubuntu20安装mysql8并设置远程连接

作者: _Rondo | 来源:发表于2022-09-22 13:08 被阅读0次

安装mysql

sudo apt update
sudo apt install mysql-server

验证

service mysql status

配置远程连接 注释掉bind-address=127.0.0.1

sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

登录到数据库修改远程连接用户

use mysql;
update user set host='%' where user='root';
GRANT ALL ON *.* TO 'root'@'%';
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'admin';
FLUSH PRIVILEGES;

重启mysql

sudo systemctl restart mysql.service

相关文章

网友评论

      本文标题:ubuntu20安装mysql8并设置远程连接

      本文链接:https://www.haomeiwen.com/subject/oplnortx.html