grant remote access of MySQL database from any IP address

后端 未结 21 1553
伪装坚强ぢ
伪装坚强ぢ 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:47

    Run the following:

    $ mysql -u root -p      
    mysql> GRANT ALL ON *.* to root@'ipaddress' IDENTIFIED BY 'mysql root password';     
    mysql> FLUSH PRIVILEGES;     
    mysql> exit
    

    Then attempt a connection from the IP address you specified:

    mysql -h address-of-remove-server -u root -p   
    

    You should be able to connect.

提交回复
热议问题