Fixed Plesk again

Current problem to fix is that the mysql version has reverted back to 3.23, making SugarCRM fail in many areas and the Plesk console not work at all (it gives a connection refused message). Plesk update seems to have been the culprit, although I specifically did not update anything related to mysql or plesk itself. Currently mysql is showing:


mysql> status
--------------
mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386)

Connection id: 36326
Current database:
Current user: admin@localhost
Current pager: stdout
Using outfile: ''
Server version: 3.23.58
Protocol version: 10
Connection: Localhost via UNIX socket
Client characterset: latin1
Server characterset: latin1
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 11 days 3 hours 11 min 26 sec

Threads: 23 Questions: 524386 Slow queries: 0 Opens: 2730 Flush tables: 1 Open tables:

64 Queries per second avg: 0.545
--------------

After backing up databases, I upgrade mysql again with rpm


rpm -U MySQL-shared-compat-4.0.26-0.i386.rpm
rpm -U MySQL-client-4.0.26-0.i386.rpm
rpm -U MySQL-server-4.0.26-0.i386.rpm

Installing all prepared tables
051019 15:53:27 /usr/sbin/mysqld: Shutdown Complete

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h u15193929.onlinehome-server.com password 'new-password'
See the manual for more instructions.

NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com

At this point, Plesk still does not work and SugarCRM has the same errors as before (with all queries that use UNION failing as the most obvious). The only difference is that mysql is no longer available from the shell:


[root@u15193929 root]# mysql -u theuser -pthepassword
-bash: mysql: command not found

I decided to reboot the server and see what might be different. Something new, the Plesk console answers with


ERROR: Unable to connect to database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 0: /usr/local/psa/admin/auto_prepend/auth.php3:81
psaerror(string "Unable to connect to database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)")

Web applications have similar error messages. Can't connect to local MySQL server. As with the prior installation, the mysql user had disappeared from the group and passwd files, so I added them back from the backup copies. Then, I issued another reboot. All is working now! This process is a lot faster when you have already done it once before and documented the steps :-P