Mysql server not starting

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
gaggio
Posts: 17
Joined: Sat Feb 13, 2016 4:04 pm

Mysql server not starting

Post by gaggio »

Hello,
I installed mysql-server via apt-get, as I don't need a LAMP stack, just a mysql server to host the Kodi database of my media players around the house.
All that I get when I try to start the server is the following failure message:

Code: Select all

root@DietPi:~# systemctl start mysql
Job for mysql.service failed. See 'systemctl status mysql.service' and 'journalctl -xn' for details.
root@DietPi:~# systemctl status mysql
● mysql.service - LSB: Start and stop the mysql database server daemon
   Loaded: loaded (/etc/init.d/mysql)
   Active: failed (Result: exit-code) since Mon 2016-03-14 09:50:14 CET; 14min ago
  Process: 8651 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
  Process: 22761 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

Mar 14 09:50:14 DietPi /etc/init.d/mysql[23494]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Mar 14 09:50:14 DietPi /etc/init.d/mysql[23494]: [61B blob data]
Mar 14 09:50:14 DietPi /etc/init.d/mysql[23494]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Mar 14 09:50:14 DietPi mysql[22761]: Starting MySQL database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
Mar 14 09:50:14 DietPi systemd[1]: mysql.service: control process exited, code=exited status=1
Mar 14 09:50:14 DietPi systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Mar 14 09:50:15 DietPi systemd[1]: Unit mysql.service entered failed state.
Any suggestion on how to solve the issue and where to look to identify the problem?

Thanks,
Federico
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Mysql server not starting

Post by Fourdee »

Hi Federico,

Thanks for the report.
I'll need some additional information on your system. Please could you send a bug report:

Code: Select all

dietpi-bugreport
Follow the onscreen instructions. You will be provided with a reference Code, please post that in your reply.

Thanks.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
gaggio
Posts: 17
Joined: Sat Feb 13, 2016 4:04 pm

Re: Mysql server not starting

Post by gaggio »

Many thanks,
Bug report sent, reference code b827eb49ad2a-0.

Thank you,
Gaggio
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Mysql server not starting

Post by Fourdee »

gaggio wrote:Many thanks,
Bug report sent, reference code b827eb49ad2a-0.

Thank you,
Gaggio
Looks like you have a missing folder in /var/log/mysql which prevents mysql service starting as it cant write to the logfile as user mysql.

Please run the following:

Code: Select all

mkdir /var/log/mysql
reboot# To update DietPi-Ramlog with the new folder it needs to generate during boot
Once rebooted, please check status again:

Code: Select all

systemctl status mysql -l
If the service isnt reporting active (running), please reply with following:

Code: Select all

ls -lha /var/log
ls -lha /var/log/mysql
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
gaggio
Posts: 17
Joined: Sat Feb 13, 2016 4:04 pm

Re: Mysql server not starting

Post by gaggio »

Now active and running!

Thank you very much for your prompt assistance
Post Reply