JPERKS1985
asked on
using mysql on fedora 6
I've imported a database from another server it loaded up fine. Now I've added a user and am trying to run a php file the php file says cannot connect to database. Using the same login as specified in the php file I'm able to connect to mysql admintrator. The php file is on the localhost as is the sql server. Perissions have been set to allow the localhost to connect. Want to run down a list of reasons I may be not able to connect to the DB? I know my php code is correct as it can connect to my old server.
ASKER
i tried that, still can't get it to work.
0is the user added in mysql table with proper rights??
is the user added with the ip address of the machine rather than localhost????
is the user added with the ip address of the machine rather than localhost????
sounds like ygoutham is correct, you can check to see if that is the problem by typing:\
GRANT ALL PRIVILEGES ON *.* TO 'you'@'%'
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
this will give "you" access to all from any host. Make sure you delete this user after you are done.
GRANT ALL PRIVILEGES ON *.* TO 'you'@'%'
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
this will give "you" access to all from any host. Make sure you delete this user after you are done.
ASKER
i'm using the gui mysql admin, for the user all the resource limits are set at 0 which is infinite I take it, the user was granted access to the proper database yet it still won't connect.
try doing it from cli.
mysql -u user -p password
GRANT ALL PRIVILEGES ON *.* TO 'you'@'%'
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql -u user -p password
GRANT ALL PRIVILEGES ON *.* TO 'you'@'%'
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
ASKER
[root@ip-207-145-62-4 ~]# mysql -u imgsrv -p imgsrv
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 22 to server version: 5.0.22
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 22 to server version: 5.0.22
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
ASKER
ERROR 1045 (28000): Access denied for user 'imgsrv'@'localhost' (using password: YES)
ASKER
second tried I logged in as root and did it
mysql> GRANT ALL PRIVILEGES ON *.* TO 'imgsrv'@'%'
-> IDENTIFIED BY '*****' WITH GRANT OPTION;
Query OK, 0 rows affected (0.02 sec)
mysql>
I am not unsuccessful at connecting to the database.
mysql> GRANT ALL PRIVILEGES ON *.* TO 'imgsrv'@'%'
-> IDENTIFIED BY '*****' WITH GRANT OPTION;
Query OK, 0 rows affected (0.02 sec)
mysql>
I am not unsuccessful at connecting to the database.
ASKER
sorry i meant to say I am still unsuccesful.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
is the DB on the same server as Apache
setenforce 0
the above command will disable selinux and try testing the code once again.