MySQL Login - SOLVED

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
cgraham149
Forum Newbie
Posts: 3
Joined: Wed May 10, 2006 9:43 pm

MySQL Login - SOLVED

Post 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?
Last edited by cgraham149 on Thu May 11, 2006 3:02 pm, edited 1 time in total.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

Hmm maybe user have not permission on database? Or maybe code not right? You post'em, code. Maybe find error.

8) :wink:
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

is the php installed on the same server as the mysql server?
User avatar
dibyendrah
Forum Contributor
Posts: 491
Joined: Wed Oct 19, 2005 5:14 am
Location: Nepal
Contact:

Post 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
cgraham149
Forum Newbie
Posts: 3
Joined: Wed May 10, 2006 9:43 pm

SOLVED

Post by cgraham149 »

SOLVED:

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

Thanks
Post Reply