On Nov 12, 2010, at 4:02 PM, willie klein wrote:
> Setting up a new server and finally splitting my apache server and mysql
> server into 2 virtual boxes.
> For some reason I can’t connect to the remote server with php but I can
> connect with mysql command line.
> I think it must be some way I compiled php, tried just using rpms also.
I'm not sure it's your php compilation. What about mysql permissions? Can you
connect via mysql command line running on your apache server to the mysql
server? Also want to make sure the port is open on the mysql server (usually
3306) and that the mysql server doesn't have "skip-networking" in it's my.cnf.
The permissions for mysql users includes the hostname that user is allowed to
connect from. If you want to open up the permissions for the user so they can
connect from any server, you want to do something like this:
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
GRANT USAGE ON *.* TO 'username'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON `dbname` . * TO 'username'@'%';
FLUSH PRIVILEGES;
The % wildcard allows the user to connect from any host.
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation