Running the mysql.sh is not creating data in /var/lib/mysql
Last Modified: Feb 16, 2019, 11:16 am
If you're trying to re-install MySQL/MariaDB, and are starting from scratch with the /usr/local/directadmin/scripts/mysql.sh, but it's not creating the mysql tables + data, this guide may be able to help. If your solution is not listed here, please create a ticket for DirectAdmin Support, so we can investigate and add it here.
Check your output, and see if any of it matches up with the scenarios below:
Within the output:
Data needs to be created in /var/lib/mysql/mysql ...
Neither host 'server.host.com' nor 'localhost' could be looked up with
Please configure the 'hostname' command to return a correct
If you want to solve this at a later stage, restart this script
with the --force option
We've encountered this error before, even though the /etc/hosts did work correctly. Solution to this one is to edit the mysql.sh and add --force to the end of the mysql_install_db line, making it look like this:
where the --force option simply skips those dns checks. DirectAdmin already makes sure that localhost exists in the /etc/hosts, so we're not concerned about these checks. Note: DirectAdmin 1.56.0 and up will use --force by default, so you'd only need to make this edit for older versions.