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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySql access problems

Status
Not open for further replies.

sweetlew

Programmer
Dec 31, 2003
36
0
0
US
I've have MySql installed with Ubuntu Linux. I now for some reason cannot login with my root user name and password. I've tried everything but get this error:

ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)'

Please someone help me with this error. I had everything working Ok until I did a DELETE FROM USER sql statement and I can't get in anymore. Thanks!!!!
 
It looks like you completely wiped out the users table from MySQL if you use DELETE FROM USER; exactly like that. You might want to try starting MySQL with the following options to try and bypass the grant tables.

mysql_safe --skip-grant-tables &

This is usually done when you forget the password for root. I'm not sure if it works if the user table is empty but give it a shot.

 
Access denied for user: 'root@localhost' (Using password: NO)'
this says you didnt use a password. but your post said you did??

Binary Intelligence, true or false?
 
Out of the box, mysql doesn't have a password for root nor does it look at the system login. If you have not specifically entered a password for root, then do not use you system password to log in, just leave it blank. Root also only has access to mysql from localhost by default so noone should be able to access root's account unless they are sitting at the server's keyboard.
 
I had everything working Ok until I did a DELETE FROM USER sql statement and I can't get in anymore.

Take a look to the [tt]mysql_install_db[/tt] script (may be in [tt]/usr/local/mysql/scripts[/tt] or in the bin directory).

Also, read this page:
Cheers.

Chacal, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top