During a recent system software upgrade (CentOS) on the front-end of our
computing cluster, the mysql area was upgraded without our realizing that it
was going to be. Now, php and mysql do not communicate well with one another.
The version of mysql on the system after the upgrade is 5.1.61. The mysql
originally used was 5.0.45. PhP was not upgraded and sits at version 5.3.3.
Execution of a simple php script on our web server
<?php
DEFINE('DB_USER','root');
DEFINE('DB_PASSWORD', 'XXXXXXX');
DEFINE('DB_HOST', 'localhost');
DEFINE('DB_NAME', 'mysql');
$dbc = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
if (!$dbc) {
die('Connect Error (' . mysql_errno() . ') ' . mysql_error());
$db_selected = mysql_select_db(DB_NAME);
if (!$db_selected) {
die ('Can\'t use' . DB_NAME . ': ' . mysql_error());
}
echo 'Success... Your connection to the Database is working';
}
?>
gives the result - Connect Error (1045) Access denied for user
'root'@'localhost' (using password: YES)
While I can access mysql in a simple fashion [mysql --user=root --pass=XXXXXXXX
gives me a mysql prompt], a straightforward mysqladmin command (mysqladmin
version) gives a similar error to the Connect Error above:
mysqladmin version
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
Do I have a msyql/php version mismatch? I have tried a number of potential
remedies I found on line but have been unsuccessful to this point. Guidance
from experts would be much appreciated.
Wayne Leslie