ubuntu 上mysql 设置远程访问

1. 安装mysql

apt-get install mysql-server

2. 设置远程访问

1. mysql -uroot -proot
2. use mysql;
3.  update user set authentication_string=password("root"),plugin='mysql_native_password',host='%' where user='root';
4. grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
5. flush privileges

你可能感兴趣的:(ubuntu 上mysql 设置远程访问)