Project

General

Profile

Support #551

Installing MariaDB on FreeBSD

Added by Daniel Curtis almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Database Server
Target version:
Start date:
02/06/2015
Due date:
% Done:

100%

Estimated time:
0.50 h
Spent time:

Description

This is a simple guide for setting up a standalone MariaDB server on FreeBSD 9.2.

  • Update the system and ports tree:
    pkg update && pkg upgrade
    

Install MariaDB server

  • Start by installing the mariadb-server and mariadb-client packages:
    pkg install mariadb55-{server,client}
    

Configure MariaDB server

  • Copy a base MariaDB configuration to use
    cp /usr/local/share/mysql/my-small.cnf /var/db/mysql/my.cnf
    
  • Tuning: Copy one of the default config files and change the max packet size:
    vi /var/db/mysql/my.cnf
    
    • and modify max_allowed_packet to 32M
      max_allowed_packet = 32M
      
  • Enable and start MariaDB
    echo 'mysql_enable="YES"' >> /etc/rc.conf
    service mysql-server start
    
  • Prepare Database for use by running the secure installation:
    mysql_secure_installation
    
    • NOTE: Choose a strong root password and answer yes to all questions.

Create MariaDB Databases and Users

  • Login to MariaDB and create appropriate databases and users.
    mysql -u root -p
    
    • and run the following SQL queries to create the somedatabase database and someuser user:
      CREATE DATABASE somedatabase CHARACTER SET utf8;
      
      CREATE USER 'someuser'@'127.0.0.1' IDENTIFIED BY 'SuperSecretPassword';
      
      GRANT ALL PRIVILEGES ON somedatabase.* TO 'someuser'@'127.0.0.1';
      
      flush privileges;
      

Also available in: Atom PDF