User Tools

Site Tools


From: mariadb
percona

Installation on Ubuntu

wget https://repo.percona.com/apt/percona-release_0.1-3.$(lsb_release -sc)_all.deb
dpkg -i percona-release_0.1-3.$(lsb_release -sc)_all.deb
apt-get update
apt-get install percona-server-server-5.7

Create UTF-8 Database and User

CREATE DATABASE `mydb` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'username'@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON `mydb`.* TO 'username'@localhost WITH GRANT OPTION;

Disable MySQL Strict Mode

Change the following line in /etc/mysql/percona-server.conf.d/mysqld.cnf from

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

to

sql_mode=NO_ENGINE_SUBSTITUTION

Dump/Restore

Dump ALL MySQL Databases

mysqldump --user=$USER --password=$PASSWORD -A > /path/to/dumpfile.sql

Dump Individual or Multiple MySQL Databases

mysqldump --user=$USER --password=$PASSWORD --databases DB_NAME1 DB_NAME2 DB_NAME3 > /path/to/dumpfile.sql

Dump only certain tables from a MySQL Database

mysqldump --user=$USER --password=$PASSWORD --databases DB_NAME --tables TABLE_NAME > /path/to/dumpfile.sql

Restore A Database

mysql --user=$USER --password=$PASSWORD DB_NAME < /path/to/dumpfile.sql

Restore All Databases

mysql --user=$USER --password=$PASSWORD < /path/to/dumpfile.sql

Disable InnoDB (to save memory for low-end box)

percona.txt · Last modified: 2019/08/25 04:01 by felixonmars