Can't start MySQL - 13.1

I’m trying to get mythtv running on 13.1 (64-bit). I was having some trouble with MariaDB, so I uninstalled it and replaced it with MySql Community. However, when I try to start MySql, I get the following:

/etc/init.d/mysql start

redirecting to systemctl start mysql
Job for mysql.service failed. See ‘systemctl status mysql.service’ and ‘journalctl -xn’ for details.

When I look at the first of those two, I get:

systemctl status mysql.service

mysql.service - LSB: Start the MySQL database server
Loaded: loaded (/etc/init.d/mysql)
Active: failed (Result: exit-code) since Mon 2013-11-25 14:39:49 CST; 58s ago
Process: 29217 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

Nov 25 14:39:49 Tonka-htpc systemd[1]: Starting LSB: Start the MySQL databa…
Nov 25 14:39:49 Tonka-htpc mysql[29217]: You are upgrading from different st…!
Nov 25 14:39:49 Tonka-htpc mysql[29217]: Make sure you to make backup of you…!
Nov 25 14:39:49 Tonka-htpc systemd[1]: mysql.service: control process exite…=1
Nov 25 14:39:49 Tonka-htpc systemd[1]: Failed to start LSB: Start the MySQL…r.
Nov 25 14:39:49 Tonka-htpc systemd[1]: Unit mysql.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.

When I run the second one, I get this:

journalctl -xn

– Logs begin at Thu 2013-11-21 17:18:25 CST, end at Mon 2013-11-25 14:42:21 CST
Nov 25 14:39:49 Tonka-htpc mysql[29217]: If you want to continue upgrading your
Nov 25 14:39:49 Tonka-htpc mysql[29217]: touch /var/lib/mysql/.force_upgrade
Nov 25 14:39:49 Tonka-htpc mysql[29217]: rcmysql restart
Nov 25 14:39:49 Tonka-htpc mysql[29217]: …failed
Nov 25 14:39:49 Tonka-htpc systemd[1]: mysql.service: control process exited, co
Nov 25 14:39:49 Tonka-htpc systemd[1]: Failed to start LSB: Start the MySQL data
– Subject: Unit mysql.service has failed
– Defined-By: systemd
– Support: systemd-devel Info Page
– Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02c

– Unit mysql.service has failed.

– The result is failed.
Nov 25 14:39:49 Tonka-htpc systemd[1]: Unit mysql.service entered failed state.
Nov 25 14:40:17 Tonka-htpc kernel: SFW2-INext-DROP-DEFLT IN=enp5s12 OUT= MAC=00:
Nov 25 14:41:12 Tonka-htpc kernel: SFW2-INext-DROP-DEFLT IN=enp5s12 OUT= MAC=00:
Nov 25 14:42:21 Tonka-htpc kernel: SFW2-INext-DROP-DEFLT IN=enp5s12 OUT= MAC=00:

If I try to start it through Services Manager, I get the full text:

Could not stop mysql which is currently enabled. mysql.service - LSB: Start the MySQL database server
Loaded: loaded (/etc/init.d/mysql)
Active: failed (Result: exit-code) since Mon 2013-11-25 14:29:56 CST; 22ms ago
Process: 28896 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

Nov 25 14:29:56 Tonka-htpc mysql[28896]: You are upgrading from different stable version of MySQL!
Nov 25 14:29:56 Tonka-htpc mysql[28896]: Make sure you to make backup of your data (mostly /var/lib/mysql)!
Nov 25 14:29:56 Tonka-htpc mysql[28896]: If you want to continue upgrading your database, run following commands:
Nov 25 14:29:56 Tonka-htpc mysql[28896]: touch /var/lib/mysql/.force_upgrade
Nov 25 14:29:56 Tonka-htpc mysql[28896]: rcmysql restart
Nov 25 14:29:56 Tonka-htpc mysql[28896]: …failed
Nov 25 14:29:56 Tonka-htpc systemd[1]: mysql.service: control process exited, code=exited status=1
Nov 25 14:29:56 Tonka-htpc systemd[1]: Failed to start LSB: Start the MySQL database server.
Nov 25 14:29:56 Tonka-htpc systemd[1]: Unit mysql.service entered failed state.

Running the commands in that error message give me the first error message above. I believe those messages are just a log of what the system attempted.

I found this thread http://forums.opensuse.org/english/get-technical-help-here/applications/478771-mysql-fails-start.html that seems to be a similar problem, but I have nothing in /var/log/mysql.

Any suggestions on how I can find more info so I can get it running? I’m a complete noob to MySql.

As the message says, run:

sudo touch /var/lib/mysql/.force_upgrade

And restart mysql.

sudo rcmysql restart

And then post the output again if it doesn’t work.

I had the same problem and fixed it somehow, can’t remember anymore how exactly.
But I started like this and got a clue…

As I said above, I tried that already:

touch /var/lib/mysql/.force_upgrade

rcmysql restart

redirecting to systemctl restart mysql
Job for mysql.service failed. See ‘systemctl status mysql.service’ and ‘journalctl -xn’ for details.

I assumed that was the same result, but it’s not. When I ran those two commands, this is what I got:

systemctl status mysql.service -l

mysql.service - LSB: Start the MySQL database server
Loaded: loaded (/etc/init.d/mysql)
Active: failed (Result: exit-code) since Mon 2013-11-25 15:32:35 CST; 2min 26s ago
Process: 30183 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

Nov 25 15:32:34 Tonka-htpc mysql[30183]: mysql.time_zone_name OK
Nov 25 15:32:34 Tonka-htpc mysql[30183]: mysql.time_zone_transition OK
Nov 25 15:32:34 Tonka-htpc mysql[30183]: mysql.time_zone_transition_type OK
Nov 25 15:32:34 Tonka-htpc mysql[30183]: mysql.user OK
Nov 25 15:32:34 Tonka-htpc mysql[30183]: Running ‘mysql_fix_privilege_tables’…
Nov 25 15:32:34 Tonka-htpc mysql[30183]: Running ‘mysqlcheck’ with connection arguments: ‘–socket=/var/tmp/mysql-protected.jG4IzN/mysql.sock’
Nov 25 15:32:34 Tonka-htpc mysql[30183]: …failed
Nov 25 15:32:35 Tonka-htpc systemd[1]: mysql.service: control process exited, code=exited status=1
Nov 25 15:32:35 Tonka-htpc systemd[1]: Failed to start LSB: Start the MySQL database server.
Nov 25 15:32:35 Tonka-htpc systemd[1]: Unit mysql.service entered failed state.

journalctl -xn -l

– Logs begin at Thu 2013-11-21 17:18:25 CST, end at Mon 2013-11-25 15:36:06 CST
Nov 25 15:32:34 Tonka-htpc mysql[30183]: Running ‘mysql_fix_privilege_tables’…
Nov 25 15:32:34 Tonka-htpc mysql[30183]: Running ‘mysqlcheck’ with connection ar
Nov 25 15:32:34 Tonka-htpc mysql[30183]: …failed
Nov 25 15:32:35 Tonka-htpc systemd[1]: mysql.service: control process exited, co
Nov 25 15:32:35 Tonka-htpc systemd[1]: Failed to start LSB: Start the MySQL data
– Subject: Unit mysql.service has failed
– Defined-By: systemd
– Support: systemd-devel Info Page
– Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02c

– Unit mysql.service has failed.

– The result is failed.
Nov 25 15:32:35 Tonka-htpc systemd[1]: Unit mysql.service entered failed state.
Nov 25 15:32:51 Tonka-htpc kernel: SFW2-INext-DROP-DEFLT IN=enp5s12 OUT= MAC=00:
Nov 25 15:34:10 Tonka-htpc kernel: SFW2-INext-DROP-DEFLT IN=enp5s12 OUT= MAC=00:
Nov 25 15:35:08 Tonka-htpc kernel: SFW2-INext-DROP-DEFLT IN=enp5s12 OUT= MAC=00:
Nov 25 15:36:06 Tonka-htpc kernel: SFW2-INext-DROP-DEFLT IN=enp5s12 OUT= MAC=00:

However, that doesn’t help me. I don’t know what any of that means. Any suggestions on where to go from here?

The MySQL version supplied with 13.1 is 5.6. This is not compatible with MariaDB and there is no intention to make MariaDB compatible with MySQL after 5.5.

If you want to switch back to MySQL, your best bet is to reinstall MariaDB, open a console and enter

mysqldump -u root -p --all-databases > /path/to/backup.sql

Then reinstall MySQL and restore the backup with

mysql -u root
source /path/to/backup.sql;
flush privileges;

If you do not want to be committed to MySQL, you need to sort out the problems within MariaDB.

Well, as I said, I had the same problem after upgrading to 13.1 and MySQL 5.6.
But I managed to fix it without dumping and restoring the database tables.

I can’t help more at the moment though, but I will be back in about 8-9 hours if you’re willing to wait… :wink:

I am not surprised; I don’t think the differences will be all that great at present and some configurations will encounter few if any problems. It may remain possible to swap simple configurations for the foreseeable future.

But the MariaDB folks are making quite clear that they will no longer guarantee compatibility other than via mysqldump for the foreseeable future.

Nothing’s easy…

I uninstalled MySql-community, then re-installed MariaDb. I ran this line and got:

mysqldump -u root -p --all-databases > backup.sql

Enter password:
mysqldump: Got error: 2002: “Can’t connect to local MySQL server through socket ‘/var/run/mysql/mysql.sock’ (2)” when trying to connect

Have you started MariaDB? :wink:

Regarding the original MySQL problem, I think I did this to get MySQL running:

rm /var/lib/mysql/.run-mysql_upgrade

And remove /var/lib/mysql/.force_upgrade as well of course if it exists now.
I got that idea from Access Denied .

Then MySQL should not try to upgrade the tables on start, which worked for me.
I have to say that I haven’t used MariaDB before though. So it was an upgrade from MySQL 5.5 to MySQL 5.6.

But OTOH, I decided to “downgrade” (or should I say “sidegrade”?) to MariaDB 5.5 afterwards (MySQL 5.6 took too much RAM and I didn’t want to play with the configuration; I wanted to try out MariaDB since a while already anyway), which worked as well with the existing database files.
For this I had to remove /var/lib/mysql/ib_logfile0 and /var/lib/mysql/ib_logfile1 though, because MariaDB complained they have the wrong size. But then everything went smooth, and no dataloss! :wink:

That said, it’s good to have a backup of /var/lib/mysql/ before playing around of course…

See the title of the thread.

I can’t start the DB.

Right, the title of the thread and the first post is about you not being able to start MySQL.

But my question was if you started MariaDB after installing it.
You didn’t say so, or that you cannot start it (or any error message you get when you start it).

Have you tried the other thing I wrote in that post?
You would have to install MySQL first of course.

I feel like I’m falling down the rabbit hole here. I’m back to MariaDB, but can’t dump the database because I can’t start the db, which is what caused me to post here in the first place.

I did rm the two files you suggested. When I then tried to start mysql, I got the following:

Could not stop mysql which is currently enabled. mysql.service - LSB: Start the MySQL database server
Loaded: loaded (/etc/init.d/mysql)
Active: failed (Result: exit-code) since Tue 2013-11-26 09:58:22 CST; 40ms ago
Process: 23128 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

Nov 26 09:58:22 Tonka-htpc mysql[23128]: Starting service MySQL warning: /var/run/mysql/mysql.sock didn’t appear within 30 seconds
Nov 26 09:58:22 Tonka-htpc mysql[23128]: chmod: cannot access ‘/var/run/mysql/mysqld.pid’: No such file or directory
Nov 26 09:58:22 Tonka-htpc systemd[1]: mysql.service: control process exited, code=exited status=1
Nov 26 09:58:22 Tonka-htpc systemd[1]: Failed to start LSB: Start the MySQL database server.
Nov 26 09:58:22 Tonka-htpc systemd[1]: Unit mysql.service entered failed state.

FWIW, since I’ve never gotten mysql running, I’m not hugely worried about saving any databases that might have been created. Maybe I’m wrong, but it seems that if I can’t start the db engine, then how could any dbs be created? Is that valid? Did I screw things up by removing mysql and installing MariaDB? That’s what’s got me feeling like I’ve fallen down the rabbit hole. I should be okay running MariaDB from what I’ve read. I found a post explaining what a person did to get mythtv running on MariaDB, and I’m hoping I can go with that. If not, I’ll have to go with mysql community until mythtv expands their db support (which they say they’re doing).

Sorry. I wasn’t trying to be a smart ass. I should have put a :wink: in there. I meant it jokingly.

But my question was if you started MariaDB after installing it.
You didn’t say so, or that you cannot start it (or any error message you get when you start it).

I can’t start MariaDB either (see above). I don’t know how to start it other than through Services Management because any documentation I found only talked about starting it automatically, not from the command-line. Then again, I didn’t look very long. The error message above came from Services Management. But ignore that (see below).

Have you tried the other thing I wrote in that post?
You would have to install MySQL first of course.

Well, yeah I did, but with MariaDB installed. :shame: I thought that MariaDB and MySQL were about the same thing, but MariaDB had improvements that MySQL lacked. So I thought that they were pretty much interchangeable.

I’m going to go back to MySQL and try your suggestion. As I said in the post above, I really don’t have any databases set up yet, or at least not any in which I care about maintaining the data. MythTV is designed to use MySQL right now, though MariaDB can be made to work. I think I need to keep it simple and go with MySQL, because I don’t understand this stuff enough to add any unnecessary complexities to it. So uninstalling MariaDB again and re-installing MySQL should destroy any databases that matter to MythTV (the only thing I’m using it for).

Hi,

have a look into the data directory (default: /var/lib/mysql). There you should find the server’s logfile; something like <hostname>.err.
It will hopefully tell you, what went wrong.

Hendrik

Success! Thank you so much for your help.

I removed MariaDB, then re-installed MySQL. I ran those two commands and was able to start MySQL.

I’ve got another, tangential. question for you… Where is MySQL installed? Running a find on mysql gives me:
/var/run/mysql
/var/lib/mysql
/var/lib/mysql/mysql
/var/lib/systemd/migrated/mysql
/var/log/mysql (log files, obviously)
/run/mysql
/etc/logrotate.d/mysql (more log files?)
/etc/init.d/mysql (startup script)
/etc/apparmor.d/abstractions/mysql (security stuff)
/etc/sysconfig/SuSEfirewall2.d/services/mysql (firewall)
/usr/lib64/mysql (libs)
/usr/lib/perl5/vendor_perl/5.18.1/x86_64-linux-thread-multi/auto/DBD/mysql (perl)
/usr/lib/perl5/vendor_perl/5.18.1/x86_64-linux-thread-multi/DBD/mysql (perl)
/usr/share/mysql
/usr/bin/mysql

So it looks like it could be in /usr/share/mysql, or maybe /var/lib/mysql (though that seems like an unlikely spot to me based on my meager knowledge of filesystem structures). There is also /usr/share/mysql-community-server.

The reason I’m asking is I’m now getting a time zone error in MySQL. I’ve found info for fixing it, but it suggests adding time zone info to mysql with the following line:

[FONT=Verdana,Arial,Helvetica][size=2]mysql_tzinfo_to_sql /usr/share/zoneinfo | /usr/local/mysql/bin/mysql -u root -p mysql [/size][/FONT]

/usr/share/zoneinfo is good, but /usr/local/mysql/bin/mysql is not valid for openSUSE. (There’s more to it than that, but that’s the first step).

I know this is off topic, but it is related.

The command which (“which mysql”) will tell you, that it is /usr/bin/mysql.
And if “which” finds it, you can start it without the absolute path; just run mysql.

Hendrik

SInce you have no databases in the system:

Set mysql not to start through Yast’s service manager
Reboot.
Completely uninstall mysql / mariadb.
Then


sudo rm -rf /var/lib/mysql
sudo rm -rf /var/run/mysql

Install these packages:
mariadb
mariadb-client
mariadb-errormessages

Then


sudo systemctl enable mysql.service

Reboot, check the mysql status afterwards:

systemctl status mysql.service

Thanks! I didn’t know about (or forgot about) that command.

I’ll give that stuff a try in a few hours. Have to finish raking leaves. :frowning:

Most of your questions have already been answered, just one note:

/var/lib/mysql most importantly contain your databases.

And you can get a list of files contained in am RPM package with “rpm -ql”:

rpm -ql mysql-community-server

:wink:

And why do you want to switch back to MariaDB now again?

Only up to 5.5; MySQL 5.6 is not the same as MariaDB 10 (the next version of MariaDB after 5.5) - see my earlier post.