Enable remote MySQL connection: ERROR 1045 (28000): Access denied for user

前端 未结 12 2250
北海茫月
北海茫月 2020-11-22 10:06

MySQL 5.1.31 running on Windows XP.

From the local MySQL server (192.168.233.142) I can connect as root as follows:

>mysql --host         


        
12条回答
  •  时光说笑
    2020-11-22 10:54

    You have to put this as root:

    GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'IP' IDENTIFIED BY 'PASSWORD' with grant option;
    

    ;

    where IP is the IP you want to allow access, USERNAME is the user you use to connect, and PASSWORD is the relevant password.

    If you want to allow access from any IP just put % instead of your IP

    and then you only have to put

    FLUSH PRIVILEGES;
    

    Or restart mysql server and that's it.

提交回复
热议问题