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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html [mysqld] user=yli # 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. # log_bin # 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 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES |
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.
1 |
[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 |
References