grant remote access of MySQL database from any IP address

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

    You can slove the problem of MariaDB via this command:

    Note:

    GRANT ALL ON *.* to root@'%' IDENTIFIED BY 'mysql root password';
    

    % is a wildcard. In this case, it refers to all IP addresses.

    0 讨论(0)
  • 2020-11-22 09:50

    Just create the user to some database like

    GRANT ALL PRIVILEGES ON <database_name>.* TO '<username>'@'%' IDENTIFIED BY '<password>'

    Then go to

    sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf and change the line bind-address = 127.0.0.1 to bind-address = 0.0.0.0

    After that you may connect to that database from any IP.

    0 讨论(0)
  • 2020-11-22 09:50

    You can disable all security by editing /etc/my.cnf:

    skip-grant-tables
    
    0 讨论(0)
提交回复
热议问题