How to specify the configuration file when starting mysqld?

In our development machine, I don’t have the root permission to install MySQL server. But our SonarQube needs it.

Fortunately, if you using the MySQL TAR archive, “root” is not required to launch mysqld but you need specify the configuration file. The default one uses some folders which need root to access.

Here is the sample mysqld configuration. You can also start from a configuration file in folder support-files.

Basically, you need specify the basedir and datadir to tell mysql where it’s installed and where the database files should be put.

Other settings can keep the same as defaults in my case. Then I start the server instance. Option “–defaults-file” is important.