Chr*_*s22 6 mysql passwords syntax wamp where
我刚刚下载并安装了WAMPserver 2.1,我想为MySQL 5.5.8数据库设置密码.我正在lynda.com和导师(Kevin Skoglund)的指导下输入:
mysql> use mysql
Database changed
mysql> UPDATE user
-> SET Password = PASSWORD('paSSword')
-> WHERE user = 'root';
Run Code Online (Sandbox Code Playgroud)
当我按Enter键时,我收到有关WHERE语句的错误:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use
near 'WHERE' user='root'; at line 2
Run Code Online (Sandbox Code Playgroud)
有谁知道WHERE语句的正确语法?他的课程是在2007年完成的,所以我想语法已经改变,因为它在视频中对他有用.这条线路为他返回:
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql>
Run Code Online (Sandbox Code Playgroud)
谢谢
这适用于我的测试服务器:
mysql> UPDATE user SET password=PASSWORD('newpassword') WHERE user ='root';
mysql> Query OK
Run Code Online (Sandbox Code Playgroud)
您正在尝试设置密码而不是密码(小写)
夏嘉曦.
小智 6
我在使用 lynda.com 教程时遇到了同样的问题。解决办法是:
UPDATE mysql.user SET Password=PASSWORD('cleartext password')
WHERE User='root';
FLUSH PRIVILEGES;
Run Code Online (Sandbox Code Playgroud)