I'm using windows 7. I've downloaded mysql-5.5.16-win32.zip
and installed it. I started MySQL server successfully, but I get this error:
C:\Program Files\Mysql\bin>mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.16 MySQL Community Server (GPL)
mysql> select user, host, password from mysql.user;
ERROR 1142 (42000): SELECT command denied to user ''@'localhost' for table 'user
'
mysql> mysql -u root -p
-> select user, host, password from mysql.user;
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 'mysql
-u root -p
select user, host, password from mysql.user' at line 1
mysql> mysql -u root -p root
-> select user, host, password from mysql.user;
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 'mysql
-u root -p root
select user, host, password from mysql.user' at line 1
mysql>
How can set the required privileges, from Windows, to the mysql table users?
The command
mysql -u root -p
is supposed to be run at the Windows command line. When you see the promptThis means you're currently using the MySQL command line client (you opened it when you first ran
mysql
on the first line of your sample).What you need to do is run the command
quit
, so you're back at the Windows command prompt, and then runThis will start the MySQL client again, but will prompt you for your password to log you in as the user
root
.