Re: Create user in MySQL
| From: | hennink at patrijs dot max dot nl | Date: | Sun, 22 Oct 2000 12:38:09 +0000 |
| Subject: | Re: Create user in MySQL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-21632@lists.php.net to get a copy of this message | ||
Hi,
maybe not a direct answer but when I'm adding a user to mysql I always use
the following syntax
grant usage on foodb.* to foo@localhost identified by('bar');
with regards,
Tijmen
On Sun, 22 Oct 2000, PHP List wrote:
> 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
>
>
>
--
Customer: I'm running Windows '98
Tech: Yes.
Customer: My computer isn't working now.
Tech: Yes, you said that.