Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restoring permission

Status
Not open for further replies.

Khoja

Technical User
Jun 10, 2002
6
CA
I was playing with the users table in mysql database. Not sure what I did, but now, I cant see any of my databases in there when I log in with Root user. I know I have not deleted them, and they still exist in my computer, but I guess I do not have permission to view them.

From command prompt, when I go to >mysql and try to add a user by:

mysql> grant all privileges on *.* to abc@localhost identified by 'abc';
ERROR 1045: Access denied for user: '@localhost' (Using password: NO)


Looks like I do not have access enough to do that. Can someone please write me, how to go about getting my permissions back?

Thanks a lot!

--Eal
 
That error message implies that you connected as an anonymous user. If you log on as the root user, it should work.

-----
ALTER world DROP injustice, ADD peace;
 
Thanks TonyGroves for your reply. I understand what you mean here, what I dont understand is how to go about solving it. I use mysql front and specify the user name as 'root' and still get the same error message when trying to add a user. However, in the left pane it does say, root@localhost

Any Idea how to go about resolving it?

Please Help!

-- Eal
 
mysql> grant all privileges on *.* to abc@localhost identified by "abc";
ERROR 1045: Access denied for user: '@localhost' (Using password: NO)
mysql> status
--------------
C:\MYSQL\BIN\MYSQL.EXE Ver 11.18 Distrib 3.23.52, for Win95/Win98 (i32)

Connection id: 54
Current database:
Current user: root;@localhost
Server version: 3.23.52
Protocol version: 10
Connection: localhost via TCP/IP
Client characterset: latin1
Server characterset: latin1
TCP port: 3306
Uptime: 6 hours 33 min 59 sec

Threads: 2 Questions: 2597 Slow queries: 0 Opens: 5 Flush tables: 1 Open ta
bles: 0 Queries per second avg: 0.110
--------------
 
According to your dump, the user is "root;". It should be "root".

-----
ALTER world DROP injustice, ADD peace;
 
Well, I fixed that user name, but am still in the same situation. Even if I was loged in as root; , it should not say '@localhost'????

I have been using Root user name for mysql front and phpmyadmin, but am in the same situation.

I would highly appreciate if you can help me with it. I can give you access to my server too =)

Thanks!

faramy@hotmail.com
 
I've sent to your e-mail address a default MySQL user table (in MyISAM form). If you stop your server, rename user.* to olduser.*, copy across the table files I sent, and restart your server, you should then be able to log on as root with no password, and do whatever you want.

-----
ALTER world DROP injustice, ADD peace;
 
Hello Tony! You are my hero! That trick did the work!!!! I am so glad that I cant explain in words - I have been working on this for past 20 hours without sleep.

I did not use your user file. Because, before I got your email, I had already reinstalled mysql on another workstation, and then took those three fresh files and just replaced with previous one and that fixed it.

Thanks a lot!!


-- Eal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top