mysql addresses two ways that remote access is not possible

  • 2020-05-15 02:21:13
  • OfStack

1. Comment out bind-address = 127.0.0.1 in the [mysqld] section of /etc/mysql/ my.cnf

2. Log in mysql with mysql-uroot-p and enable remote access by:

Method 1: mysql > use mysql;
mysql > update user set host = '%' where user = 'root';

mysql > FLUSH RIVILEGES;

Method 2: mysql > GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;


Related articles: