Support #788
Install MariaDB 10 on FreeBSD
Description
This is a simple guide on setting up a MariaDB 10 server on FreeBSD 10.
Prepare the Environment¶
- Make sure the system is up to date:
pkg update && pkg upgrade
Install MariaDB server¶
- Start by installing the mariadb100-server and mariadb100-client packages:
pkg install mariadb100-{server,client}
- Copy a base MariaDB configuration to use:
cp /usr/local/share/mysql/my-small.cnf /var/db/mysql/my.cnf
- Edit the mariadb config to change the max packet size:
vi /var/db/mysql/my.cnf
- and modify
max_allowed_packet
to 32Mmax_allowed_packet = 32M
- and modify
- Enable and start MariaDB
echo 'mysql_enable="YES"' >> /etc/rc.conf service mysql-server start
- Prepare the 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 somedb database and someuser user:
CREATE DATABASE somedb CHARACTER SET utf8; CREATE USER 'someuser'@'localhost' IDENTIFIED BY 'SuperSecretPassword'; GRANT ALL PRIVILEGES ON somedb.* TO 'someuser'@'localhost'; FLUSH PRIVILEGES; quit
- and run the following SQL queries to create the somedb database and someuser user: