MySQL: How to allow remote connection to mysql

后端 未结 16 1166
北海茫月
北海茫月 2020-11-21 06:15

I have installed MySQL Community Edition 5.5 on my local machine and I want to allow remote connections so that I can connect from external source.

How can I do that

16条回答
  •  遇见更好的自我
    2020-11-21 06:56

    After doing all of above I still couldn't login as root remotely, but Telnetting to port 3306 confirmed that MySQL was accepting connections.

    I started looking at the users in MySQL and noticed there were multiple root users with different passwords.

    select user, host, password from mysql.user;
    

    So in MySQL I set all the passwords for root again and I could finally log in remotely as root.

    use mysql;
    update user set password=PASSWORD('NEWPASSWORD') where User='root';
    flush privileges;
    

提交回复
热议问题