Results 1 to 4 of 4

Thread: How to re-create default DBs for MariaDB?

  1. #1

    Default How to re-create default DBs for MariaDB?

    I messed up something and another program installed its tables inside the database named mysql.

    Then I tried to recreate that db using mysql_install_db but the extra tables were still there so I forcefully deleted the db hoping that I will be able to run successfully mysql_install_db again after that. Now I can't even start the mysql service. Reinstalling mariadb didn't help.

    Considering that I still have no other db's - how do clean up the situation, i.e. wipe out the 3 default service db's (information_schema, performance_schema and mysql) and recreate them start from scratch, set again root db password etc?

  2. #2

    Default Re: How to re-create default DBs for MariaDB?

    Today I renamed /var/lib/mysql to /var/lib/mysql_old and then I ran mysql_install_db again. The result is:

    http://paste.opensuse.org/5c69c7cc

    In journalctl I see: http://paste.opensuse.org/13c2aa8e

    and systemctl status mysql.service gives http://paste.opensuse.org/955d8166

    Still stuck

  3. #3

    Default Solved

    Finally fixed it:

    Code:
    rm -rf /var/lib/mysql
    rcmysql restart
    Now it works.

  4. #4

    Default Re: How to re-create default DBs for MariaDB?

    Quote Originally Posted by heyjoe View Post
    and systemctl status mysql.service gives http://paste.opensuse.org/955d8166
    The messages indicate that mysql/mariadb couldn't open some files because of wrong permissions.
    The most likely reason for this is IMHO that they were owned by a different user than "mysql" (the database server runs as user "mysql").

    You probably shouldn't run mysql_install_db as root, but rather as user "mysql" I suppose.

    But as you found out, you don't have to run it at all anyway. The start script does so automatically if /var/lib/mysql/ doesn't exist.

Tags for this Thread

Posting Permissions

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