I've just downloaded and installed WAMPserver 2.1 and I want to set a password for the MySQL 5.5.8 database. I'm doing a tutorial at lynda.com and the tutor (Kevin Skoglund) instructions to type:
mysql> use mysql
Database changed
mysql> UPDATE user
-> SET Password = PASSWORD('paSSword')
-> WHERE user = 'root';
When I hit enter, I get this error about the WHERE statement:
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
Does anyone know the correct syntax for the WHERE statement? His lessons were done in 2007, so I guess the syntax has changed because it worked for him in the video. This line was returned for him:
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql>
Thanks
Create a text file containing the password-assignment statement on a single line. Replace the password with the password that you want to use. ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass'; Save the file.
This works on my test server:
mysql> UPDATE user SET password=PASSWORD('newpassword') WHERE user ='root';
mysql> Query OK
You are trying to set Password instead of password (lowercased)
Shai.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With