Support #551

Installing MariaDB on FreeBSD

Added by Daniel Curtis over 9 years ago. Updated over 9 years ago.

Database Server
Target version:
Start date:
Due date:
% Done:


Estimated time:
0.50 h
Spent time:


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:
    • 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'@'' IDENTIFIED BY 'SuperSecretPassword';
      GRANT ALL PRIVILEGES ON somedatabase.* TO 'someuser'@'';
      flush privileges;

Updated by Daniel Curtis over 9 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Updated by Daniel Curtis over 9 years ago

  • Status changed from Resolved to Closed

Updated by Daniel Curtis over 9 years ago

  • Target version set to FreeBSD 9

Updated by Daniel Curtis over 9 years ago

  • Category set to Database Server

Also available in: Atom PDF