Page 1 of 1

MySQL Login - SOLVED

Posted: Wed May 10, 2006 9:47 pm
by cgraham149
Does anyone know why I CAN login to MySQL from a shell but can NOT from a PHP app using the same user/pass?

Posted: Wed May 10, 2006 10:25 pm
by neophyte
Hmm maybe user have not permission on database? Or maybe code not right? You post'em, code. Maybe find error.

8) :wink:

Posted: Wed May 10, 2006 11:31 pm
by Burrito
is the php installed on the same server as the mysql server?

Posted: Thu May 11, 2006 4:22 am
by dibyendrah
What is the error ?
Something like access denied root@localhost or someuser@localhost or some other authentication issues ? or script error at line ... ?

If the error is not shown, you may use

Code: Select all

or die(mysql_error())
or tweak the php.ini

Code: Select all

error_reporting  =  E_ALL & ~E_NOTICE
display_errors = On
error_log = /var/log/php5/php5_err.log
After that restart the apache server to see the effect !

Cheers.
Dibyendra

SOLVED

Posted: Thu May 11, 2006 3:02 pm
by cgraham149
SOLVED:

GRANT ALL PRIVILEGES ON dbName.* TO userName@'localhost' identified by '********';

Thanks