I at all, write this tutorial for helping other people to create a MySQL specific istance for DOL.
Create new instances with MySQL is not difficult since fortunately provides a command called mysqld_multi and the possibility to use the same configuration file for all instances or use a different file specific whit directive --defaults-file and in this tutorial we will use exactly this technique.
Note: Tested this step on ubuntu (13.04 / 13.10 64bit).
Create specific directory
If not present you need to create a new directory called mysql_multi in /etc/mysql
- Code: Select all
sudo mkdir /etc/mysql/mysql_multi
Open your .bashrc whit preferred editor and add this line
- Code: Select all
alias mysqld_multi='mysqld_multi --defaults-file=/etc/mysql/mysql_multi/my.cnf'
To be properly invoked the new istance must be identified by a number (called GNR) that separate it from the others present. For example the section of the mysql in new my.cnf file takes the name of mysql1.
Create /etc/mysql/mysql_multi/my.cnf and add the following line
- Code: Select all
[mysqld_multi] mysqld = /usr/bin/mysqld_safe mysqladmin = /usr/bin/mysqladmin log = /var/log/multi_mysql.log [mysqld1] user = mysql pid-file = /var/run/mysqld/mysqld1.pid socket = /var/run/mysqld/mysqld1.sock basedir = /usr datadir = /var/lib/mysql1 tmpdir = /tmp lc-messages-dir = /usr/share/mysql log-error = /var/log/mysqld1.log key_buffer = 16M max_allowed_packet = 16M thread_stack = 192K thread_cache_size = 8 myisam-recover = BACKUP query_cache_limit = 1M query_cache_size = 16M expire_logs_days = 10 max_binlog_size = 100M skip-grant-tables
Create mysql database
Now we need to create the initial database for new instance.
- Code: Select all
sudo mysql_install_db --user=mysql --datadir=/var/lib/mysql1
- Code: Select all
sudo mysqld_multi start
For this you need to start the first time the service with the directive skip-grant-tables, so you can access however to the database and make the necessary corrections than installed by mysql_install_db. Now connect at mysql whit the following command
- Code: Select all
sudo mysql -h mysql1.hostname -u root
- Code: Select all
DROP DATABASE test; use mysql DELETE FROM user WHERE user=''; UPDATE user SET host='mysql1.hostname' WHERE host='your-pc-name'; UPDATE user SET Password=PASSWORD("your_preferred_password") WHERE User="root";
InnoDB
InnoDB is enabled by default for files larger than 10MB but unfortunately do not yet know enough about the operation of DOL and its database so I can give advice about the best configuration I could be wrong completely.
Have fun