Results 1 to 12 of 12

Thread: mariadb update failed

  1. #1
    Join Date
    Feb 2015
    Posts
    17

    Angry mariadb update failed

    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?

  2. #2
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,482
    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.

  3. #3
    Join Date
    Feb 2015
    Posts
    17
    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.

  4. #4
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,482
    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.

  5. #5
    Join Date
    Feb 2015
    Posts
    17
    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.

  6. #6
    Join Date
    Feb 2015
    Posts
    17
    New update.... same problem. I guess there is a VPS problem.... i have no clue...

  7. #7
    Join Date
    Apr 2009
    Posts
    2,186
    @akadi81, Do you use Debian? If so please make sure you have upgraded to the newest DirectAdmin version wich has a fix. Please see https://directadmin.com/features.php?id=2182

  8. #8
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,482
    @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.

  9. #9
    Join Date
    Feb 2015
    Posts
    17
    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 by akadi81; 09-19-2018 at 03:57 AM.

  10. #10
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,482

  11. #11
    Join Date
    Feb 2015
    Posts
    17
    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.

  12. #12
    Join Date
    Aug 2006
    Location
    LT, EU
    Posts
    7,236
    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
    Martynas Bendorius
    MB Martynas IT. Professional server management company. Official DirectAdmin, CloudLinux, LiteSpeed and Comodo partners.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •