Databases :: MySql :: ERROR 1047: Unknown command |
|||
| By: sahrom |
Date: 21/06/2003 00:00:00 |
Points: 500 | Status: Answered Quality : Excellent |
|
I was getting an access denied error, this was solved in an earlier posting, using "skip-grant-table" in the my.ini Now I am trying to the following and I get the following error: mysql> create database BookDB; ERROR 1007: Can't create database 'bookdb'. Database exists mysql> grant all privileges on BookDB.* to sarumi@localhost identified by 'pxxxxx' with grant option; ERROR 1047: Unknown command mysql> grant all on BookDB.* to sarumi@localhost identified by 'pxxxxxx'; ERROR 1047: Unknown command mysql> when I looked up what error 1047 = ER_UNKNOWN_COM_ERROR which gives the following definition = The MySQL server doesn't implement this command (probably an old server) so is my sytex wrong ? and what should I ask? I am using 4.0.12-nt Thanks |
|||
| By: VGR | Date: 21/06/2003 07:14:00 | Type : Answer |
|
| 1) if you launched mysqld with sjip-grant-table, it's no wonder GRANT commands do not work afterwards :D 2) if not, are you sure your current user has sufficient rights to set GRANT options (usually, you are 'root' to do so) recommended course of action : 1) start mysqld with skip-grant-table option, if not already done 2) connect to mysql with : mysql --user=root 3) then do : use mysql; select * from user; # check users, hosts, password presence or absence 4) issue : update user set Password=PASSWORD('somepassword') WHERE User='root' AND Host='localhost'; flush privileges; quit 5) stop mysqld 6) delete skip-grant-table in my.ini 7) restart server normally : safe_mysqld & 8) connect as root mysql --user=root --password=somepassword 9a) if you don't obtain the prompt, come back here complainign and explaining :D 9b) if you got the mysql> welcome prompt, then do : grant all privileges on BookDB.* to sarumi@localhost identified by 'pxxxxx' with grant option; flush privileges; quit 10) done. |
|||
| By: sahrom | Date: 21/06/2003 08:15:00 | Type : Comment |
|
| VGR, Thank you very very much. It worked, your instructions were very good - that is what i needed- the exact steps . One of my problems was I was not "logging in" as: mysql --user=root - I didn't understand that i should do this when i was trying to figure things out :-) |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








