Can’t establish connection to MySQL after PHP upgrade

When you upgrade PHP there are chances that the new version is reading a different php.ini file than the previous version. You have to see which php.ini it’s reading (for example with phpinfo()) and then check that it has correctly configured the pdo_mysql.default_socket, mysql.default_socket and mysqli.default_socket options. They are probably empty:

pdo_mysql.default_socket =
mysql.default_socket =
mysqli.default_socket =

And they should have something like this:

pdo_mysql.default_socket = /opt/local/var/run/mysql55/mysqld.sock
mysql.default_socket = /opt/local/var/run/mysql55/mysqld.sock
mysqli.default_socket = /opt/local/var/run/mysql55/mysqld.sock

mysql

You might also like

Fix apt-get “cannot copy extracted data for ‘…’ to ‘…’: unexpected end of file or stream”
I was doing an apt-get upgrade and got this error:Preparing to replace liborc-0.4-0:armhf 1:0.4.16-2...

MacPorts: Update port definitions and upgrade installed ports
Once in a while is good to update your software to get advantage of the latest bug fixes and new features....

Can’t change user options in MySQL Administrator
May be you installed MySQL 5 and you are not able to change user information, schema privileges and resources...

Can’t change user options in MySQL Administrator
May be you installed MySQL 5 and you are not able to change user information, schema privileges and resources...

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.