List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:January 29 2002 1:24am
Subject:Re: mysql access control
View as plain text  
At 13:15 +0100 1/28/02, Joachim Hörnle wrote:
>The mysql access control is drinving me crazy.
>I have installed MySQL Version 3.23.47 on Suse Linux 7.2 (Kernel 2.4.4)
>After the installation of mysql  I run the mysql_install_db script
>I could change the passwords for root so I reset the GRANT table using
>../safe_mysqld --skip-grant-tables
>and than I set the passwords manually using
>myql -u root mysql
>mysql> INSERT INTO user (Host,User,Password)
>             VALUES(''%','root',PASSWORD('abc'));
>mysql> INSERT INTO user (Host,User,Password)
>             VALUES('localhost','root',PASSWORD('abc'));

That defines entries in the user table, but doesn't set any of the global
privileges.  As a result, they're all set to the default of 'N'.  This
means you'll be able to connect, but you won't be able to use any

I'd predict that if you ran your mysql commands below without specifying
the database on the end, that you'd be able to connect.  But then if you
issue a USE mysql; statement, you'll get an access denied error.

>I can set the password for e.g root (atleast I don't get any error 
>message) using
>mysqladmin -h localhost -u root -p password 'def'
>but when I try to access the DB using
>mysql -h localhost -u root -p mysql
>(depending on the password) I get the following error message:
>ERROR 1044: Access denied for user: 'root@localhost' to database 
>'mysql' (if I use abc as password)
>ERROR 1045: Access denied for user: 'root@localhost' (Using 
>password: YES) (if I use def as password)
>Any suggestion or idea would be appreciated. Thanks!
>Joachim Hoernle

mysql access control(Joachim Hörnle)29 Jan
  • Re: mysql access controlPaul DuBois29 Jan