LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 05-26-2003, 11:28 PM   #1
tangle
Senior Member
 
Registered: Apr 2002
Location: Holmesville, Ohio
Distribution: Slackware
Posts: 1,721

Rep: Reputation: 52
MySQL error 1064


I have created a database in mysql with a couple of tables. When I goto grant privileges to a user I get an error. Here is what I did.

mysql> grant select, insert, update, delete
-> on mail.*
-> to mail@localhost indentitfied by 'password';

Then I get an error messege saying :
ERROR 1064: You have an error in your SQL syntax near "indentified by 'password' ' at line 3

I got this out of a book that I have been reading. I also looked it up on google. What is the propper syntax? Thanks
 
Old 05-26-2003, 11:47 PM   #2
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 45
mysql> grant select, insert, update, delete on mail.* to mail@localhost identified by 'password';
 
Old 11-16-2004, 01:17 AM   #3
mik22
LQ Newbie
 
Registered: Nov 2004
Posts: 1

Rep: Reputation: 0
Lightbulb 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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 15 04-22-2012 01:32 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
Starting MySQL OLD Error : imeout error occurred trying to start MySQL Daemon Fr33B5D Linux - Software 9 10-28-2006 06:23 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
error 1064 mysql Tredo Linux - Security 4 12-02-2004 05:24 PM


All times are GMT -5. The time now is 03:28 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration