Redpeaks Cockpit
User Guide
Support
User Guide
Support
yum localinstall mysql80-community-release-el7-1.noarch.rpm yum install mysql-community-server systemctl enable mysqld systemctl start mysqld
systemctl stop mysqld mkdir /agentil/mysql # The new DB folder cp -rf /var/lib/mysql/* /agentil/mysql mv /var/lib/mysql /var/lib/mysql.backup chown -R mysql /agentil/mysql chgrp -R mysql /agentil/mysql ln -s /agentil/mysql /var/lib/mysql
service mysqld start or systemctl start mysqld
mysqld --initialize
mysql -u root -p
ALTER USER root@'localhost' IDENTIFIED BY 'xxxxxxxxx';
Example for MAIN database:
mysql --user=root -p CREATE DATABASE MAIN; USE MAIN; CREATE USER 'superadmin'@'%' identified by 'XXXXXXXX'; GRANT ALL PRIVILEGES ON MAIN.* TO 'superadmin'@'%';
Example for TENANT database:
mysql --user=root -p CREATE DATABASE TENANT; USE TENANT; CREATE USER 'tenantadmin'@'%' identified by 'XXXXXXXX'; GRANT ALL PRIVILEGES ON TENANT.* TO 'tenantadmin'@'%';
Edit /etc/mysql/my.cnf and add below parameter
disable-log-bin
sort_buffer_size = 15M
[mysqldump] password="[SECRET]"
CREATE USER 'backup'@'localhost' IDENTIFIED BY '[SECRET]'; GRANT SELECT, PROCESS ON *.* TO 'backup'@'localhost';
#!/bin/sh mysqldump -u root --single-transaction --databases [DB_NAME] > /[DB_FS]/[DB_NAME]_`date +%Y-%m-%d`.sql gzip /[DB_FS]/[DB_NAME]_`date +%Y-%m-%d`.sql find /pmlogs/mysql/backups -name "*" -mtime +7 -delete
crontab -e
0 22 * * * /[SCRIPTS]/do_backups.sh