mariadb update failed

akadi81

Verified User
Joined
Feb 26, 2015
Messages
60
Hi,
I just updated from 10.2.15 to 10.2.16 and the sql server is not starting anymore.

2018-07-04 12:29:07 0 [ERROR] Can't open and lock privilege tables: Table './mysql/servers.MYI' is read only
2018-07-04 12:29:07 0 [Note] Server socket created on IP: '::'.
2018-07-04 12:29:07 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table './mysql/user.MYI' is read only

I tried to update to 10.3.8 too, same result.
I made a backup for /home/mysql and try to reinstall mariadb (https://help.directadmin.com/item.php?id=563)
Same results.

Any ideeas?
 
Hello,

Do you have a separate partition for /var/lib/mysql?

Try
Code:
/usr/local/directadmin/scripts/set_permissions.sh mysql
and see whether or not it fixes the error with writing, and allows MySQL to start.
 
There is no separate partition for mysql. I tryed even chmod 777 for every **** just to make it start.
Nothing worked with mariadb.

I made a backup of mysql data and after replace with mysql 5.7 it's working.
I got some performance_schema errors but it't working.

I will reinstall that VPS, but directadmin got a "-1" from me with this update that broke sql with no warning. :(


Thank for your response, Alex.
 
An upgrade process might have failed and/or you had another copy of MariaDB running... Directadmin uses rpm packages on CentOS (if you run it of course).

The MySQL/MariaDB update is the one that produces the most issues at least in my practice and I don't think Directadmin is one that should be blamed.

It does not help anybody if you simply "unlike it"... if there is bug it should be reported either to Directadmin or to MariaDB developers.
 
I agree with you.
But i used directadmin tool for update, and i got errors. Nothing new, dealing with servers you got errors and situations all the time. But my server was down for about 3 hours because of me thinking that using that tool it's safe.

I have 4 directadmin servers and 2 updates where ok, 1 crashed, and.... i am not that brave to update the last one. :)

I have no ideea what hapents, so am not able to report a bug anywere.

After all, directadmin is a great tool if you know how to use/tune it.
I miss a responsive theme/ios app for it and a responsive theme for roundcube also.

Alex i am sure you know, but for everybody reading this: backup is the key!

Thank you.
 
New update.... same problem. I guess there is a VPS problem.... i have no clue...
 
@akadi81,

Yes, backups are very important. And by the way rolling binaries of MariaDB on Debian back is rather simple in the case, upgrades failed, and no table was changed during it.

@ditto,

Thanks for the link. I overlooked the changes in Directadmin, they describe the reasons of the issue.
 
Thank you for your replays, but my system is still down.

I am using Debian GNU/Linux 8.

@zEitEr, do you have some instruction to fix this situation?

@ditto, that fix is not solving the problem: "Existing systems will not be affected. This only applies to new installs."
 
Last edited:
So the problem was before 2018-07-04 when i posted the first time, and now we have enough clues to solve it.

Editing /etc/my.cnf was waste of time, because /etc/systemd/system/mariadb.service is passing datadir from command line parameters.

ExecStart=/usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/mysqld.pid --socket=/usr/local/mysql/data/mysql.sock


1. backup! cp /home/mysql to some backup folder!!!
2. remove symlink with rm /usr/local/mysql/data
3. copy /home/mysql to /usr/local/mysql/data

Problem solved.
Thank you very much.
 
Please do not leave the data in /usr/local/mysql/data. It's dangerous to have it there, as it will be removed with the next update of MySQL/MariaDB. Please execute the following to fix it from the current point (when you have data in /usr/local/mysql/data):
Code:
systemctl stop mysqld
mv /usr/local/mysql/data /var/lib/mysql
ln -s /var/lib/mysql /usr/local/mysql/data
systemctl start mysqld
 
Back
Top