MySQL error 1064
I had the same problem here is what I figured out. First here is the line that worked grant select, insert, update, delete, index, alter, create, drop on database.* to user identified by 'password'; Where database is the database and you do need the .* after it, user is the user name and 'password' is the password you want between the ' '. If you still get the same log into the database as root with (you also have to bee root of the database for the grant command) by typing the following:
/usr$ mysql -u root -p
and then enter the password you have for root then do the following
mysql> use mysql;
mysql> select * from user;
Then look for the user you are trying to grant the privileges to or a user with the same name as the database and run the following to delete the user(s)
mysql> delete from user where User=' ';
put the user name between the ' '
you should also run if with no space between ' ' to remove the ability to log on anonymously.
I hope this helps, my problem was that I had a user with the same name as the database and the user was trying to grant already existed. It may have been just because I had a user with the same name as the database but I don't know because I removed them both before I tried again.
|