ubuntu允许远程root登录

1.开启3306端口

mysql -u root -p登录

grant all privileges on . to root@’%’ identified by ‘123456’; //允许123456 密码
flush privileges; //更新权限
输入命令:vim /etc/mysql/mysql.conf.d/mysqld.cnf
将 bind-address 改成如下所示:以支持在其他机器上连接数据库
bind-address = 0.0.0.0
service mysql restart 重启

附加 修改mysql密码 ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘123456’ 修改密码为 123456

猜你喜欢

转载自blog.csdn.net/qq_25261441/article/details/114667263