Configure the way mysql allows remote connections

  • 2020-05-15 02:17:24
  • OfStack

vim /etc/my.cnf
Comment this 1 line: bind-address =127.0.0.1 == > #bind-address=127.0.0.1
Save to exit.
mysql -uroot -p123456

Grant permissions to users who require remote login:


mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "123456";
mysql> flush privileges;

Remote login command:
mysql-h 223.4.92.130-uroot-p (-h is followed by the ip address of the host to be logged into)


Related articles: