Mysql not starting after update to v159

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

Mysql not starting after update to v159

Post by gaggio » Tue Feb 13, 2018 9:12 am

Goodmorning,
after the update to v159, Mysql daemon is not starting anymore. See the following messages:

Code: Select all

# 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 Tue 2018-02-13 10:09:59 CET; 41s ago
  Process: 31320 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
                                                                                                                                                                                                                   
Feb 13 10:09:59 DietPi /etc/init.d/mysql[32143]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in                                                                
Feb 13 10:09:59 DietPi /etc/init.d/mysql[32143]: [61B blob data]                                                                                                                                                   
Feb 13 10:09:59 DietPi /etc/init.d/mysql[32143]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'                                                                     
Feb 13 10:09:59 DietPi /etc/init.d/mysql[32143]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!                                                                           
Feb 13 10:09:59 DietPi /etc/init.d/mysql[32143]:                                                                                                                                                                   
Feb 13 10:09:59 DietPi mysql[31320]: Starting MySQL database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!                                                                    
Feb 13 10:09:59 DietPi systemd[1]: mysql.service: control process exited, code=exited status=1
Feb 13 10:09:59 DietPi systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Feb 13 10:09:59 DietPi systemd[1]: Unit mysql.service entered failed state.
Suggestions?

Many thanks

User avatar
MichaIng
Legend
Posts: 382
Joined: Sat Nov 18, 2017 5:21 pm

Re: Mysql not starting after update to v159

Post by MichaIng » Tue Feb 13, 2018 12:01 pm

Please check your mysql error log. There might be an issue with mysql configuration.

Which version of mysql and OS are you using, and do you use Nextcloud or ownCloud?

gaggio
Posts: 13
Joined: Sat Feb 13, 2016 3:04 pm

Re: Mysql not starting after update to v159

Post by gaggio » Tue Feb 13, 2018 1:06 pm

Thanks for your reply, here are the versions:

Code: Select all

Linux DietPi 4.9.62-v7+ #2 SMP Fri Nov 17 23:52:26 GMT 2017 armv7l GNU/Linux

Code: Select all

mysql  Ver 14.14 Distrib 5.5.59, for debian-linux-gnu (armv7l) using readline 6.3 
As far as the logs are concerned, all the following are just empty:
/var/log/mysql.log
/var/log/mysql.err
/var/log/mysql/error.log

Thank you

gaggio
Posts: 13
Joined: Sat Feb 13, 2016 3:04 pm

Re: Mysql not starting after update to v159

Post by gaggio » Tue Feb 13, 2018 1:10 pm

Sorry, forgot the last point: I'm using Nextcloud.

User avatar
WarHawk
Posts: 372
Joined: Thu Jul 20, 2017 7:55 am

Re: Mysql not starting after update to v159

Post by WarHawk » Tue Feb 13, 2018 1:30 pm

new version no longer using mysql, using MariaDB

gaggio
Posts: 13
Joined: Sat Feb 13, 2016 3:04 pm

Re: Mysql not starting after update to v159

Post by gaggio » Tue Feb 13, 2018 2:06 pm

Do you suggest that my working mysql installation might have been re-configured by the scripts during upgrade and therefore is not working anymore? By the way, I have no MariaDB installed, and as far as I know the two database servers should be completely compatible for external programs accessing to the database. Besides nextcloud, I had Kodi instances sharing the library through Mysql.

User avatar
WarHawk
Posts: 372
Joined: Thu Jul 20, 2017 7:55 am

Re: Mysql not starting after update to v159

Post by WarHawk » Wed Feb 14, 2018 2:05 am

sorry, i thought you updated from 159 to 6. don't know why it's starting, I know going from 159 to 6 mysql is replaced

User avatar
MichaIng
Legend
Posts: 382
Joined: Sat Nov 18, 2017 5:21 pm

Re: Mysql not starting after update to v159

Post by MichaIng » Thu Feb 15, 2018 2:06 am

@gaggio:
MySQL logs can be also found within journalctl -r best directly after service restart attempt.

Can you try to remove/backup the /etc/mysql/conf.d/99-dietpi-4byte.cnf and restart mysql?
If it works, you also have to remove the 4byte setting from Nextcloud config.php.

Actually this settings should work with MySQL, but since it was the only thing we touched on 159 update, it is worth trying.

gaggio
Posts: 13
Joined: Sat Feb 13, 2016 3:04 pm

Re: Mysql not starting after update to v159

Post by gaggio » Thu Feb 15, 2018 9:14 am

Thanks for your reply. Unfortunatley, even removing that file, the result is still the same. With journalctl -r the messages are the same I posted before, just in reverse order:

Code: Select all

Feb 15 09:21:41 DietPi systemd[1]: Unit mysql.service entered failed state.                                                                                                                                        
Feb 15 09:21:41 DietPi systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Feb 15 09:21:41 DietPi systemd[1]: mysql.service: control process exited, code=exited status=1                                                                                                                     
Feb 15 09:21:41 DietPi mysql[26670]: Starting MySQL database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!                                                                    
Feb 15 09:21:41 DietPi /etc/init.d/mysql[27457]:                                                                                                                                                                   
Feb 15 09:21:41 DietPi /etc/init.d/mysql[27457]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!                                                                           
Feb 15 09:21:41 DietPi /etc/init.d/mysql[27457]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'                                                                     
Feb 15 09:21:41 DietPi /etc/init.d/mysql[27457]: [61B blob data]                                                                                                                                                   
Feb 15 09:21:41 DietPi /etc/init.d/mysql[27457]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in  

User avatar
johnvick
Legend
Posts: 556
Joined: Wed Jun 08, 2016 10:53 am
Location: New Zealand

Re: Mysql not starting after update to v159

Post by johnvick » Thu Feb 15, 2018 9:46 am

Have you tried to create the file /var/run/mysqld/mysqld.sock ? (assuming it does not exist)

And then restart MySql?

I had the same error a while back and this was the solution.

John

Post Reply