List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:November 1 1999 6:45pm
Subject:Re: problems with mysql, user permissions
View as plain text  
At 9:40 AM -0800 11/1/99, papowell@stripped wrote:
>>Description:
>	I have run into a very strange question with users, permissions,
>mysql,  and documentation contradictions.
>
>Note:  Umm... the last version of mysql I used was 1.xxx something,
>I shudder to recall,  so things may have changed.
>
>This is a little complicated,  so I will describe the actions
>I took.
>
>I installed mysql, followed directions.  Version 3.22.27,
>did a raw source install,  did not use FreeBSD ports distribution.
>
>used mysqladmin to set up root mysql password.
>
>I then tried to create the databases and tables that I needed.
>This step worked fine.
>
>i.e. -
>
>create.sql:
>
>	create database sutter;
>
>	create table sutter.callbox (
>	   id char(16) NOT NULL;
>	   comment text;
>	   index key( char );
>	);
>
>	create table sutter.sensors (
>	   id char(16) NOT NULL;
>	   comment text;
>	   index key( char );
>	);
>
>mysql -u root -p <create.sql
>
>This went fine,  I checked the entries with mysql and they were there.
>
>Then I tried to create a user who could access this table,
>
>I used the mysql_permissions script,  and added a user 'test' to access
>the datbase.  I checked this with mysql:
>
>| Host | Db      | User   | Select_priv | Insert_priv | Update_priv 
>| Delete_priv | Create_priv | Drop_priv | Grant_priv | 
>References_priv | Index_priv | Alter_priv |
>+------+---------+--------+-------------+-------------+-------------+ 
>-------------+-------------+-----------+------------+----------------- 
>+------------+------------+
>| %    | test    |        | Y           | Y           | Y 
>| Y           | Y           | Y         | Y          | Y 
>| Y          | Y          |
>| %    | test\_% |        | Y           | Y           | Y 
>| Y           | Y           | Y         | Y          | Y 
>| Y          | Y          |
>| %    | sutter  | test   | Y           | Y           | Y 
>| Y           | Y           | Y         | Y          | Y 
>| Y          | Y          |
>+------+---------+--------+-------------+-------------+-------------+ 
>-------------+-------------+-----------+------------+----------------- 
>+------------+------------+
>
>+------------+--------+------------------+-------------+------------- 
>+-------------+-------------+-------------+-----------+-------------+- 
>--------------+--------------+-----------+------------+--------------- 
>--+------------+------------+
>| Host       | User   | Password         | Select_priv | Insert_priv 
>| Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv 
>| Shutdown_priv | Process_priv | File_priv | Grant_priv | 
>References_priv | Index_priv | Alter_priv |
>+------------+--------+------------------+-------------+------------- 
>+-------------+-------------+-------------+-----------+-------------+- 
>--------------+--------------+-----------+------------+--------------- 
>--+------------+------------+
>| localhost  | root   | 68d4f47c49a579c9 | Y           | Y 
>| Y           | Y           | Y           | Y         | Y 
>| Y             | Y            | Y         | Y          | Y 
>| Y          | Y          |
>| h9.private | root   |                  | Y           | Y 
>| Y           | Y           | Y           | Y         | Y 
>| Y             | Y            | Y         | Y          | Y 
>| Y          | Y          |
>| localhost  |        |                  | N           | N 
>| N           | N           | N           | N         | N 
>| N             | N            | N         | N          | N 
>| N          | N          |
>| h9.private |        |                  | N           | N 
>| N           | N           | N           | N         | N 
>| N             | N            | N         | N          | N 
>| N          | N          |
>| %          | test   |                  | N           | N 
>| N           | N           | N           | N         | N 
>| N             | N            | N         | N          | N 
>| N          | N          |
>+------------+--------+------------------+-------------+------------- 
>+-------------+-------------+-------------+-----------+-------------+- 
>--------------+--------------+-----------+------------+--------------- 
>--+------------+------------+
>
>Note that the user table has Host='%', User='test', and Password=''.
>
>Also, User 'test' has permissions on the 'sutter' database.
>
>Just to be paranoid,  I used 'mysqladmin -u root -p reload',  to force mysql
>to reload the user information.
>
>
>Now I tried the following:
>
>h9: {95} % mysql -u test
>Welcome to the MySQL monitor.  Commands end with ; or \g.
>Your MySQL connection id is 112 to server version: 3.22.27
>
>Type 'help' for help.
>
>mysql> use sutter
>ERROR 1044: Access denied for user: '@localhost' to database 'sutter'
>mysql>
>
>
>Observe carefully:
>   a) I did NOT give a password.  This should result in a '' password.
>   b) mysql reports '@localhost'  instead of 'test@localhost' - it seems
>      not to use the user name.
>
>OK - I am baffled.  What am I doing wrong.


Remove the entries from the user table that have blank User column
values, reload the grant tables, and try again.

-- 
Paul DuBois, paul@stripped
Thread
problems with mysql, user permissionspapowell1 Nov
  • Re: problems with mysql, user permissionssinisa1 Nov
  • Re: problems with mysql, user permissionsPaul DuBois1 Nov