visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Databases :: MySql :: ERROR 1047: Unknown command


By: sahrom U.S.A.  Date: 21/06/2003 00:00:00  English  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 English  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 English  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

EContact
browser fav
page generated in 294.022080 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page