Support #551
Installing MariaDB on FreeBSD
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 32Mmax_allowed_packet = 32M
- and modify
- 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;
- and run the following SQL queries to create the somedatabase database and someuser user:
Updated by Daniel Curtis almost 10 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100