grant remote access of MySQL database from any IP address

后端 未结 21 1559
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 09:18

I am aware of this command:

GRANT ALL PRIVILEGES
ON database.*
TO \'user\'@\'yourremotehost\'
IDENTIFIED BY \'newpassword\';

But then it on

21条回答
  •  一生所求
    2020-11-22 09:33

    Use this command:

    GRANT ALL ON yourdatabasename.* TO root@'%' IDENTIFIED BY 'yourRootPassword';
    

    Then:

    FLUSH PRIVILEGES; 
    

    Then comment out the below line in file "/etc/mysql/mysql.conf.d/mysqld.cnf" (is required!):

    bind-address = 127.0.0.1 
    

    Works for me!

提交回复
热议问题