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

前端 未结 12 2245
北海茫月
北海茫月 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:55

    The user/host combination may have been created without password.

    I was assuming that when adding a new host for an existing user (using a GUI app), the existing password would also be used for the new user/host combination.

    I could log in with

    mysql -u username -p PASSWORD
    

    locally, but not from IPADDRESS with

    mysql -u --host=HOST -p PASSWORD
    

    (I could actually log in from IPADDRESS without using a password)

    mysql -u --host=HOST
    

    Setting the password allowed access:

    set password for ''@'' = '';
    

提交回复
热议问题