User Tools

Site Tools


percona

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

percona [2017/01/05 06:29] (current)
felixonmars created
Line 1: Line 1:
 +==== Installation on Ubuntu ====
 +<​code>​
 +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
 +</​code>​
 +
 +==== Create UTF-8 Database and User ====
 +<​code>​
 +CREATE DATABASE `mydb` CHARACTER SET utf8 COLLATE utf8_general_ci;​
 +GRANT ALL ON `mydb`.* TO `username`@localhost IDENTIFIED BY '​password';​
 +</​code>​
 +
 +==== Disable MySQL Strict Mode ====
 +Change the following line in /​etc/​mysql/​percona-server.conf.d/​mysqld.cnf from
 +<​code>​
 +sql_mode=NO_ENGINE_SUBSTITUTION,​STRICT_TRANS_TABLES
 +</​code>​
 +to
 +<​code>​
 +sql_mode=NO_ENGINE_SUBSTITUTION
 +</​code>​
 +
 +==== Dump/​Restore ====
 +
 +Dump ALL MySQL Databases
 +
 +<​code>​
 +mysqldump --user=$USER --password=$PASSWORD -A > /​path/​to/​dumpfile.sql
 +</​code>​
 +
 +Dump Individual or Multiple MySQL Databases
 +
 +<​code>​
 +mysqldump --user=$USER --password=$PASSWORD --databases DB_NAME1 DB_NAME2 DB_NAME3 > /​path/​to/​dumpfile.sql
 +</​code>​
 +
 +Dump only certain tables from a MySQL Database
 +
 +<​code>​
 +mysqldump --user=$USER --password=$PASSWORD --databases DB_NAME --tables TABLE_NAME > /​path/​to/​dumpfile.sql
 +</​code>​
 +
 +Restore A Database
 +
 +<​code>​
 +mysql --user=$USER --password=$PASSWORD DB_NAME < /​path/​to/​dumpfile.sql
 +</​code>​
 +
 +Restore All Databases
 +
 +<​code>​
 +mysql --user=$USER --password=$PASSWORD < /​path/​to/​dumpfile.sql
 +</​code>​
 +
 +==== Disable InnoDB (to save memory for low-end box) ====
 +
 +<​code>​
 +skip-innodb
 +default-storage-engine=myisam
 +</​code>​
 +
 +Add to the `[mysqld]` section inside your `my.cnf`
 +
 +References:
 +
 +  * http://​www.patrickpatoray.com/?​Page=30
 +  * http://​forums.mysql.com/​read.php?​28,​25356,​25470#​msg-25470
 +  * http://​forums.fedoraforum.org/​archive/​index.php/​t-20329.html
 +  * https://​www.euperia.com/​development/​mysql-create-database-with-utf8-character-set-syntax/​1064
  
percona.txt ยท Last modified: 2017/01/05 06:29 by felixonmars