At 16:22, 19990815, john smith wrote:
>The root user(and only the root user) does not seem to be able to use
>the system at all. For all commands, I get back :
>ERROR 1045: Access denied for user: 'root@localhost' (Using password:
John, I hope you haven't wiped out your installation just because
of this error! If you have, well, hopefully you learned something
from installing the tar.gz version and you are a better person for
it. If you haven't, then don't despair!
First, you did give a lot of information in your message, but you
didn't give the most important: a list of your privilege tables
(especially the mysql.user table). The problem is almost certainly
that your privilege tables are not quite right (or that you need to
Maybe you're thinking, "If I can't access the database as the 'root'
user, then how am I supposed to show you my privilege tables?" The
one disadvantage of the new (well, it's not really new anymore, I
guess) GRANT command is that most people don't ask about privileges
anymore, so if you're just watching the mailing list (but not used
to searching the archive) you won't find the answer to this question
as easily as before.
Now, I'll stop babbling and get to the point.
If you just can't access/modify the privilege tables because you
can't get in as a user with proper access, then you should stop
the database (you may kill the mysqld daemon process, just don't
use -9 (-KILL) and it will be okay). Then restart it with the
-Sg flag, which skips the grant tables. Now any user can access
the database with no password.
Issue something like these commands:
mysql> GRANT ALL PRIVILEGES ON *.* TO superman
-> IDENTIFIED BY 'PaS$w0rD' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
Now you should shut down the server ('mysqladmin shutdown'), and
try to access:
$ mysql -u superman -p mysql
Password: ******** (You type PaS$w0rD here)
mysql> SELECT * FROM user;
Your 'superman' user can now do anything to any table. You could
use the name 'root' instead of 'superman', if you prefer. But if
this doesn't work, then at least 'SELECT * FROM mysql.user' and
show us what it has in it.