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: /mariadb/mariadb/libexec /mariadb/mariadb/sbin /mariadb/mariadb/bin 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
- Downloaded the MariaDB.tar.gz
- Created a directory called /mariadb/
- Extracted the MariaDB.tar.gz and created a symbolic link called mariadb
- Created a user group and username for MariaDB directory
- Created /mariadb/data for storing MariaDB data file (Database)
Copy the pre-written configuration file by this command.
cp mariadb/support-files/my-medium.cnf mariadb/data/my.cnf
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
Copy the init.d script from support files in the right location:
- Edit /etc/init.d/mariadb replacing mysql with mariadb
Run mysql_install_db by explicitly giving it the my.cnf file as argument:
Although on step 10, I can't follow this command. So I did what I stated above and shown the error.