Project

General

Profile

Support #379

Updated by Daniel Curtis about 10 years ago

h2. Install MariaDB 

 h3. Install MariaDB from pkg 

 Install MariaDB:  
 <pre> 
 pkg install mariadb55-{server,client} 
 </pre> 

 h3. Build MariaDB from Source 

 * Install MariaDB, this will also build the MariaDB client: 
 <pre> 
 cd /usr/ports/databases/mariadb55-server/ 
 make config ; make install clean 
 rehash 
 </pre> 

 h2. Configure MariaDB 

 * Edit @rc.conf@ to start MariaDB at boot: 
 <pre> 
 vi /etc/rc.conf 
 </pre> 

 * Add @mysql_enable@ 
 > mysql_enable="YES" 

 * Manually start MariaDB: 
 <pre> 
 service mysql-server start 
 </pre> 

 Setup grant tables, make sure to have the MariaDB server running since mysql_install_db assumes its running from here: 
 <pre> 
 cd /usr/local/ 
 mysql_install_db --user=mysql 
 </pre> 

 * Configure the MariaDB server root password: 
 <pre> 
 mysql_secure_installation 
 </pre> 
 *# (Optional) Configure MariaDB server root password manually: 
 <pre> 
 mysqladmin -u root password 'appleton' 
 mysqladmin -u root -p -h firefly.scc.local password 'appleton' 
 </pre> 
 *# (Optional) Grant root permission to connect remotely: 
 <pre> 
 mysql -u root -p 
 mysql> grant all privileges on *.* to 'root'@'%' identified by 'appleton' with grant option; 
 mysql> exit; 
 </pre> 

 h2. Configure MariaDB Server 

 Use the provided @my-medium.cnf@ config file and edit for using InnoDB tables: 

 The output from “my_print_defaults –help” implies my-medium.cnf should copied to /etc/my.cnf, but I’ll use the MySQL convention I’ve learned until I know different. 
 <pre> 
 cp /usr/local/share/mysql/my-medium.cnf /var/db/mysql/my.cnf 
 vi /var/db/mysql/my.cnf 
 </pre> 
 > #! Uncomment the following if you are using InnoDB tables 
 > innodb_data_home_dir = /var/db/mysql 
 > innodb_data_file_path = ibdata1:10M:autoextend 
 > innodb_log_group_home_dir = /var/db/mysql 
 > #! You can set .._buffer_pool_size up to 50 - 80 % 
 > #! of RAM but beware of setting memory usage too high 
 > innodb_buffer_pool_size = 16M 
 > innodb_additional_mem_pool_size = 2M 
 > #! Set .._log_file_size to 25 % of buffer pool size 
 > innodb_log_file_size = 5M 
 > innodb_log_buffer_size = 8M 
 > innodb_flush_log_at_trx_commit = 1 
 > innodb_lock_wait_timeout = 50 

 * Restart MariaDB: 

 # service mysql-server restart 

 * And finally do a basic test to confirm things are basically working: 
 <pre> 
 mysql -u root -p 
 </pre> 
 > MariaDB [(none)]> show databases; 
 > MariaDB [(none)]> exit; 
 > Bye

Back