|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Access Denied: mysql5 php5
SUSE 10.1
PHP Version 5.1.2 MySQL Client API version 5.0.18 Apache/2.2.0 (Linux/SUSE) I can't get php5 to connect to mysql 5. With or without a password. <html><body><h1>Test MySQL Database connection</h1> <h2> <?php // (1) //$mysql= new mysqli("localhost", "galewpuser", "galewppass", "galewp"); // (2) $mysql= new mysqli("localhost", "galewpuser", "", "galewp"); printf("Error: %sn", mysqli_connect_error()); ?> </h2> </body></html> results of (1) with the correct password set with MySQL Administrator are Error: Access denied for user 'galewpuser'@'localhost' (using password: YES) results of (2) with password set to "" are Error: Access denied for user ''@'localhost' to database 'galewp' all privs are granted between galewpuser and the galewp database no other privs are granted between galewpuser and any other catalogs. I had this working on WinXP with php4 and mysql4 and had to use OLD_PASSWORDS to make it work. I understand that OLD_PASSWORDS are history in these "5" days. Thanks, ww |
|
#2
|
|||
|
|||
|
And the ANSWER IS!!
And the answer is that you have to add @localhost to the list of hosts explicitly @%, which is a wildcard and you would think would include localhost, apparently does not.
* So, under the username in MyAdmin / Users panel, select the user you want to change, right click and choose Add Host. * Then choose Localhost * then be sure and update the privs to include all the privs for the desired database's. hummm..... Yep, you would think that WILDCARD meant WILDCARD including LOCALHOST but it apparently does not. sigh. ww |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Installation > Access Denied: mysql5 php5 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|