Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

Recently our builds have started failing because MySQL can no longer be reached through its socket. Here is an instance of a failing build:

The command that starts the service, sudo systemctl start mysql, does not output any error message.
I have tried changing the distribution, waiting a bit before connecting, but to no avail.

Any help would be greatly appreciated!

1 Like

Looks like

1 Like

I face the same issue. My build works well, but in recent days, when it runs in xenial as default, I always get error messge:

amysqladmin: connect to server at ‘localhost’ failed

for command mysqladmin create woocommerce_test --user=root --password= --host=localhost --protocol=tcp

My solution is force it use trusty by add dist:trusty into .yml file. But if there’s any way to make it work in xenial, please let me know.

Just reply my own message. I find the way to make my build work on xenial, just need add mysql into service list in .travis.yml

  • mysql