mysql8允许外网访问(转载+整理)
需要操作兩部分
①
subl /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address?? ??? ?= 0.0.0.0
sudo service mysql restart
②
mysql> use mysql;
Database changed
mysql> update user set host='%' where user ='appleyuchi';
mysql> FLUSH PRIVILEGES;
?
查看效果:
mysql> select host,user,plugin from user;
+-----------+------------------+-----------------------+
| host ? ? ?| user ? ? ? ? ? ? | plugin ? ? ? ? ? ? ? ?|
+-----------+------------------+-----------------------+
| % ? ? ? ? | appleyuchi ? ? ? | mysql_native_password |
| % ? ? ? ? | root ? ? ? ? ? ? | auth_socket ? ? ? ? ? |
| localhost | debian-sys-maint | caching_sha2_password |
| localhost | mysql.infoschema | caching_sha2_password |
| localhost | mysql.session ? ?| caching_sha2_password |
| localhost | mysql.sys ? ? ? ?| caching_sha2_password |
+-----------+------------------+-----------------------+
6 rows in set (0.00 sec)
?
最后測試效果:
mysql -uappleyuchi -hDesktop -p
就可以登錄了。
其中的Desktop是遠程IP
?
?
總結
以上是生活随笔為你收集整理的mysql8允许外网访问(转载+整理)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: kafka的SASL的适用业务场景
- 下一篇: 手机版自动点击器怎么使用