ERROR 1064 (42000): You have an error in your SQL syntax; Want to configure a password as root being the user

后端 未结 10 2212
再見小時候
再見小時候 2020-12-13 07:53

I have just downloaded WAMP. I want to configure a password for the MySQL root user using MySQL console. No password has been set previously.

The following is the in

10条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-13 08:21

    If you have ERROR 1064 (42000) or ERROR 1046 (3D000): No database selected in Mysql 5.7, you must specify the location of the user table, the location is mysql.table_name Then the code will work.

    sudo mysql -u root -p
    
    UPDATE mysql.user SET authentication_string=password('elephant7') WHERE user='root';
    

提交回复
热议问题