Hi, I'm trying to get PHP on my Webserver to connect to a dedicated MySQL server machine. But I always get a login failure diplayed on the page when I access the PHP page. I'm using the right login credentials but do I have to configure something in the MySQL user tables?
regards from Iceland, Kristinn
Make sure you have the right user/pass on the mySQL.. mySQL has its own users with passwords.. use mysqladm to create a user and password..
Also, check the port that MySQL is running on. If it is NOT the default, specify the correct port in MySQL section of your php.ini
Also check the host in mysql. MySQL can limit users attempting to login to certain hosts. For example : I use a virtual server. The only times I'll ever access MySQL are from a telnet session or through PHP. So I set all my users 'host' field to localhost. If you want your users to be able to log in from anywhere, make sure you leave the host field blank, or if you know the hosts you'll be logging in from, populate the host field with that.
Create an account GRANT INSERT,DELETE,... on dbname.* to userid@'hostname' identified by 'passwd'
userid@'%' <--- user can connect from anywhere
userid@'hostname' <-- user can ONLY connect from this hostname
What version of PHP? - In the PHP 4.0.0 there was a MySQL port-related bug.
Are you able to connect from the PHP-server to the MySQL-server with the mysql shell?
I think files necessary for connectivity between the PHP and MySQL are not installed at all or not installed properly. Check out if the installation is complete. I faced similar problem which was corrected when files were downloaded and installed .
Give it a try