What to do if MariaDB doesn't start

You are viewing an old version of this article. View the current version here.

Need additional support? We're here to help!

  Contact Us

There could be many reasons that MariaDB fails to start. This page will help troubleshoot some of the more common reasons and provide solutions.

If you have tried everything here, and still need help, you can ask for help on IRC or on the forums - see Where to find other MariaDB users and developers - or ask a question at the Starting and Stopping MariaDB page.

The Error Log and the Data Directory

The reason for the failure will almost certainly be written in the Error Log and, if you are starting MariaDB manually, to the console. By default, the error log is named host-name.err and is written to the data directory.

Common Locations:

  • /var/log/
  • /var/log/mysql
  • C:\ProgramData\Mysql
  • C:\Program Files\MySQL\MySQL Server x.x\data (x.x refers to the version number)

It's also possible that the error log has been explicitly written to another location, either by changing the datadir system variable, or setting with log-error=filename - see my.cnf below.

In most cases you should be able to find out the place of the error file by doing:

mysqld --help --verbose | grep 'log-error' | tail -1
mysqld --help --verbose | grep 'datadir' | tail -1

my.cnf

The other main file to consider is the my.cnf file. It contains configuration settings, such as the location of the data directory mentioned above. If you're unsure where the my.cnf file is, see configuring MariaDB with my.cnf.

You can see what is in the configuration file for the MariaDB server (mysqld) by executing:

mysqld --print-defaults

or

my_print_defaults mysqld server mysqld-10.0 mariadb mariadb-10.0 client-server

Can't open privilege tables

If you get the following error:

System error 1067 has occurred.
Fatal error: Can't open privilege tables: Table 'mysql.host' doesn't exist

critical files, such as the privilege tables, are either missing or are in the wrong location. By default, MariaDB will create the privilege tables in the correct location, but the above error is quite common after an upgrade, where the configuration files point to a different location. See configuring MariaDB with my.cnf to find the my.cnf (or my.ini) configuration file/s.

Make sure that the basedir and datadir variables are correctly set.

An incorrect my.cnf setting

When you upgrade to a new version of MariaDB, in most cases the old my.cnf configuration will work just fine. However, it's possible that one of the variables set there has been removed in the new version, or one of the values is no longer valid. Remember that the options are case sensitive. Examine the specifics of the error, and then remove the invalid setting from the my.cnf file, or change it to the new name, or a valid value. There should be an error like this:

140514 12:19:37 [ERROR] /usr/local/mysql/bin/mysqld: unknown variable 'option=value'

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.