MT6 MySQL
Jump to navigation
Jump to search
Install MySQL
jailmanage mysql pkg install -y mysql56-server
Configure Startup
echo 'mysql_enable="YES"' >> /etc/rc.conf service mysql-server start
Configure Users
Note the credentials generated here. You will need them later:
tee /root/mail-toaster-mysql-users.sh <<'EO_GEN_USERS' #/bin/sh PASS=`openssl rand -hex 18` echo "create database dspam;" SQL="GRANT ALL PRIVILEGES ON dspam.* to 'dspam'@'127.0.0.7' IDENTIFIED BY '$PASS';" echo $SQL PASS=`openssl rand -hex 18` echo "create database spamassassin;" SQL="GRANT ALL PRIVILEGES ON spamassassin.* to 'spamassassin'@'127.0.0.6' IDENTIFIED BY '$PASS';" echo $SQL PASS=`openssl rand -hex 18` echo "create database roundcubemail;" SQL="GRANT ALL PRIVILEGES ON roundcubemail.* to 'roundcube'@'127.0.0.10' IDENTIFIED BY '$PASS';" echo $SQL PASS=`openssl rand -hex 18` echo "create database squirrelmail;" SQL="GRANT ALL PRIVILEGES ON squirrelmail.* to 'squirrelmail'@'127.0.0.10' IDENTIFIED BY '$PASS';" echo $SQL PASS=`openssl rand -hex 18` echo "create database vpopmail;" SQL="GRANT ALL PRIVILEGES ON vpopmail.* to 'vpopmail'@'127.0.0.8' IDENTIFIED BY '$PASS';" echo $SQL EO_GEN_USERS sh /root/mail-toaster-mysql-users.sh
Copy the output of that script, open up a new mysql session with the mysql client, and paste in the results:
mysql mysql> [PASTE] mysql> quit exit
See Also
tuning
Use mysqltuner. Install it with:
pkg install mysqltuner