I am following the instruction on the MariaDB site here all is fine until I get to the part shown below.

[root@squir scripts]# mysql_install_db --defaults-file=/mariadb/data/my.cnf

FATAL ERROR: Could not find mysqld

The following directories were searched:


If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.

If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.

I wonder if there is the problem with the directory structure that is confusing the install. The documentation is also old, so I am not sure if there is a step missing.

What I Have done So far

  1. Downloaded the MariaDB.tar.gz
  2. Created a directory called /mariadb/
  3. Extracted the MariaDB.tar.gz and created a symbolic link called mariadb
  4. Created a user group and username for MariaDB directory
  5. Created /mariadb/data for storing MariaDB data file (Database)
  6. Copy the pre-written configuration file by this command.

    cp mariadb/support-files/my-medium.cnf mariadb/data/my.cnf

  7. Edited the my.cnf file as per instructed in here

    [client] port = 3307 socket = /mariadb/data/mariadb.sock

    [mysqld] datadir = /mariadb/data basedir = /mariadb/mariadb port = 3307 socket = /mariadb/data/mariadb.sock user = mariadb

  8. Copy the init.d script from support files in the right location:

  9. Edit /etc/init.d/mariadb replacing mysql with mariadb
  10. Run mysql_install_db by explicitly giving it the my.cnf file as argument:

    scripts/mysql_install_db --defaults-file=/opt/mariadb-data/my.cnf

Although on step 10, I can't follow this command. So I did what I stated above and shown the error.

  • What are you trying to do? meta.serverfault.com/questions/3608/… – GioMac Sep 12 '13 at 11:41
  • I am installing MariaDB on my server, but I don't want to remove mysql, yet. From the link provided above, I am about to install the server files as based on the my.cnf (Configuration file). I type that command and the problem shows up. @GioMac – Mr A Sep 13 '13 at 2:27
  • please provide more info about your installation. – GioMac Sep 13 '13 at 2:33
  • @GioMac Could you be specific on on what you are looking for? – Mr A Sep 13 '13 at 7:15
  • What have you done so far, your distribution, etc – GioMac Sep 13 '13 at 7:16

basedir is "base" directory, where all bin lib etc directories reside.

Change basedir = /mariadb/mariadb to basedir = /mariadb.

Also, I guess my.cnf location is somewhere at /mariadb/data/my.cnf, change --defaults-file=/opt/mariadb-data/my.cnf accordingly.

Also, mysql_install_db must run from /mariadb with scripts/mysql_install_db

mysql_install_db will call script from /usr/bin, not the one from /mariadb/scripts/.

It's better to follow standards and install it under /opt/.

Also, be sure selinux is in permissive mode:


set "permissive" in /etc/sysconfig/selinux

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.