grant remote access of MySQL database from any IP address

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

    • START MYSQL using admin user
      • mysql -u admin-user -p (ENTER PASSWORD ON PROMPT)
    • Create a new user:
      • CREATE USER 'newuser'@'%' IDENTIFIED BY 'password'; (% -> anyhost)
    • Grant Privileges:
      • GRANT SELECT,DELETE,INSERT,UPDATE ON db_name.* TO 'newuser'@'%';
      • FLUSH PRIVILEGES;

    If you are running EC2 instance don't forget to add the inbound rules in security group with MYSQL/Aurura.

提交回复
热议问题