Re: PHP3/MySQL Error 1044 - Lost User
| From: | Ashley Whitney | Date: | Fri, 02 Jun 2000 12:33:41 +0000 |
| Subject: | Re: PHP3/MySQL Error 1044 - Lost User | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-176@lists.php.net to get a copy of this message | ||
It seems more likely to me that this is a MySQL error than a PHP
error. When granting privileges in MySQL you usually either make an
'account' for local access or external access, as required (so, if both
are required, you make both). To make an external it's just:
GRANT ALL PRIVILEGES ON mydb.* TO user@'%' IDENTIFIED BY 'password';
or locally:
GRANT ALL PRIVILEGES ON mydb.* TO user@localhost IDENTIFIED BY 'password';
Hope that helps.
On Fri, 2 Jun 2000, Michael A Beckmann wrote:
> I just started with PHP & MySQL so this may be an obvious one.
> I set up a MySQL database and I just want to list the content of the
> table. Connecting to the server and the database works fine but when the
> query runs I get the following error message:
>
> 1044: Access denied for user: '@myserver' to database 'mydb'
>
> This the PHP code I am using:
>
> ...
> $link = mysql_connect("myserver","anonymous");
> if ($link > 0)
> {
> if (mysql_select_db("mydb", $link))
> {
> $result = mysql_query("SELECT * FROM mytable",$link);
> echo mysql_errno() . ": " . mysql_error() . "<br>";
> ...
>
>
> Any help would be appreciated.
>
> Regards,
>
> Michael Beckmann
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>