List:MySQL and PHP« Previous MessageNext Message »
From:Wayne G Leslie Date:November 26 2012 5:45pm
Subject:FW: mysql and php not communicating after upgrade
View as plain text  
Thanks to those who replied.  In the end it turned out to be a two-fold problem.  The
first was a permissions problem in /var/lib/mysql/ - I needed to change the ownership in
my folder from root to mysql.  The second problem had to do with where php was looking
for the mysql socket.  I had to modify the location in /etc/php.d/mysql.ini.

Wayne
________________________________
From: Rich Onyon [rich@stripped]
Sent: Monday, November 26, 2012 11:07 AM
To: Wayne G Leslie
Subject: Re: mysql and php not communicating after upgrade

Try forcing a reset of your root password and then run upgrade.
http://dev.mysql.com/doc/refman/5.1/en/resetting-permissions.html

Good luck.


On Mon, Nov 26, 2012 at 7:31 AM, Wayne G Leslie
<wgleslie@stripped<mailto:wgleslie@stripped>> wrote:

Thanks Rich.  As a complete mysql/php newbie, I didn't see this in all the documentation. 
Unfortunately, the results are quite similar to my other results:

mysql_upgrade --verbose
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck with default connection arguments
mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost' (using password:
NO) when trying to connect
FATAL ERROR: Upgrade failed

I must have some very basic underlying problem that I do not understand.

Wayne

________________________________
From: Rich Onyon [rich@stripped<mailto:rich@stripped>]
Sent: Monday, November 26, 2012 12:04 AM
To: Wayne G Leslie
Subject: Re: mysql and php not communicating after upgrade

Try running mysql_upgrade.

http://dev.mysql.com/doc/refman/5.1/en/upgrading-from-previous-series.html

Sent from my iPhone

On Nov 25, 2012, at 9:01 PM, Wayne G Leslie
<wgleslie@stripped<mailto:wgleslie@stripped><mailto:wgleslie@stripped<mailto:wgleslie@stripped>>>
wrote:


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



--
Rich Onyon
Lead Developer
+1.818.495.4698
Keep Calm & Chive On


Thread
FW: mysql and php not communicating after upgradeWayne G Leslie26 Nov