sudo apt-get install mysql-client-core-5.7
sudo apt-get install mysql-server-5.7
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
找到bind-address = 127.0.0.1
改为: bind-address = 0.0.0.0
,或者直接将其注解掉
允许任意IP访问;
之后重启mysql服务
sudo service mysql restart
登录mysql(root用户下密码为空)
mysql -u root -p
修改表数据
mysql> update mysql.user set host="%" where user="root";
mysql> update mysql.user set plugin="mysql_native_password" where user="root";
mysql> flush privileges;
mysql> quit;
大功告成!
“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill
标 题:ubuntu安装mysql并且允许远程访问