Click to See Complete Forum and Search --> : Problem connecting to database


EviLBoX
10-07-2002, 04:27 PM
I'm using Red Hat 7.3 and I have successfully installed Apache/PHP/MySQL.

I have several different databases created in the var directory, one of which is test_database that was provided when I installed MySQL, and the other being mydb that I created. Both databases appear identical as I do an "ls -l" to see the attributes. Connecting directly through MySQL I can access both databases and perform querys on them, but when I try to connect through PHP, I can only connect to the test_database, not the one I created mydb. Anyone have any clue as to why I can't connect to "mydb" through PHP? I'm assuming it might have something to do with access rights? I don't know.... Thanks.

monkeyboi
10-08-2002, 01:51 AM
did u setup a unprevilege username for that database??

cuz the test database is unprotected anyone can connect...

i asume u create the mydb under root (i mean mysql root not linux root)

anyway log in as root
type this command..

mysql>grant select,update,delete,insert to anyusername.* on mydb@localhost identified by 'yourpass';

use that username and pass u jux create to connect to mydb