Failed to start mysql.service on xenial


#1

I tried to switch to xenial with enabled mySQL service.

services:
  - mysql

dist: xenial

But now I get the following error messages:

$ sudo systemctl start mysql
Failed to start mysql.service: Unit mysql.service is masked.
MySQL did not start within 10 seconds

and then later…

$ mysql -e 'create database test;'
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
The command "mysql -e 'create database test;'" failed and exited with 1 during .

How can I start the mysql service on xenial correctly?


#2

Hey there,

Sorry to hear that! Could you please share the full build log and/or config so we can look at it and see if there’s anything that’s missing? If it’s for a private project, please send an email to support@travis-ci.com. :slight_smile:


#3

Hi @kris

This was the content of the file travis.yml.

I think it was noting really special. I just added the dist: xenial in this commit.

And here is the build job log 495324256 and raw log.txt file.

Error message in line 245:

$ sudo systemctl start mysql
Failed to start mysql.service: Unit mysql.service is masked.
MySQL did not start within 10 seconds

#4

I found the problem with MySQL.

MySQL 5.7 is the default on the Xenial image. On Trusty, you can install MySQL 5.7

I just had to remove the Trusty specific settings for MySQL and it works:

image

Thanks :slight_smile: