MT6 MySQL

From The Network People, Inc. - Wiki
Jump to navigation Jump to search
Mail Toaster 6
Start Installation
FreeBSD Upgrade
DNS Upgrade
MySQL Upgrade
ClamAV Upgrade
AVG Upgrade
SpamAssassin Upgrade
Rspamd Upgrade
dspam Upgrade
Vpopmail Upgrade
Haraka Upgrade
Haproxy Upgrade
webmail Upgrade
Monitor Upgrade
testing

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