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.
# For advice on how to change settings please see
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# These are commonly set, remove the # and set as required.
basedir = /home/yli/mysql-5.6.16-linux-glibc2.5-x86_64
datadir = /home/yli/sonar_mysql_db
# port = .....
# server_id = .....
# socket = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
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.
[yli@my_laptop ~/mysql-5.6.16-linux-glibc2.5-x86_64]$ bin/mysqld --defaults-file=/home/yli/mysql-5.6.16-linux-glibc2.5-x86_64/my.cnf