Re: Create user in MySQL

From: Date: Mon, 23 Oct 2000 07:42:32 +0000
Subject: Re: Create user in MySQL
Groups: php.general 
Request: Send a blank email to php-general+get-21731@lists.php.net to get a copy of this message
Two possibilities. First, did you remember to reload the MySQL privilege tables after making the changes? (eg mysqladmin reload). Second, if you did a by-the-book MySQL install you may find that you have some very open access rules providing global access to a test database that are taking precedence over your specific access rules. The command line utility mysqlaccess that comes with the MySQL distribution is a script which will help diagnose the problem. Regards Nick Talbott IT Policy and Strategy Manager, Powys County Council, UK email nickt@powys.gov.uk FAX +44 (0) 1597 824781 web http://www.powys.gov.uk and http://www.powysweb.co.uk -----Original Message----- From: PHP List <phplist@webbcite.com> To: php-general@lists.php.net <php-general@lists.php.net> Date: 22 October 2000 08:55 Subject: [PHP] Create user in MySQL >I am having trouble creating a user and db permissions in MySQL. I get the >following error when trying to access a database after creating user and db >permissions: > >Warning: MySQL Connection Failed: Access denied for user: 'foo@localhost' >(Using password: YES) > >Following are the insert statements I used to create user and db >permissions: > >$sql = "INSERT INTO user (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) VALUES ('localhost', 'foo', >PASSWORD('bar'), 'Y', >'Y', 'Y', 'N', 'N', 'N', 'N', >'N', 'N', 'N', 'N', 'N', 'N', >'N')"; > >$sql = "INSERT INTO db (Host, Db, User, Select_priv, Insert_priv, >Update_priv, >Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv, >Index_priv, Alter_priv) VALUES ('localhost', 'data_base', 'foo', >'Y', 'Y', >'Y', >'N', 'N', 'N', 'N', 'N', 'N', >'N')"; > >The above informatin is being correctly inserted into the user and db tables >of the database. I have viewed the info and it looks to be consistant with >how it should be. Do I need to insert information into any other mysql db >tables? > >I appolize that this is not specifically a PHP question, but I know there >are a lot of MySQL experts on this list. > >Any help would be appreciated as I have been stumped on this for a while. > >Thanks, >Scott > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#21731) next »