MySQL8允许root远程连接

MySQL8允许root远程连接,mysql 8 allow remote access。

Don't do this

mysql>use mysql;
mysql>update user set host='%' where user='root';
mysql>flush privileges;

Solution

Best Practices:

mysql>use mysql;
mysql>CREATE USER 'remote_user'@'ip' IDENTIFIED BY 'MyNewPass4!';
mysql>GRANT ALL ON *.* TO 'remote_user'@'ip';
mysql>flush privileges;