Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the ad-inserter domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/blog.webeats.it/httpdocs/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the cookie-law-info domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/blog.webeats.it/httpdocs/wp-includes/functions.php on line 6114
Migrare da MySQL a Percona MySQL su Ubuntu - Blog WebEats

Il passaggio è molto semplice. Basta eseguire dal terminale un pò di comandi per passare al più performante Percona MySQL.

Vediamo come fare:

prima di tutto stoppiamo il demone MySQL con il comando
service mysql stop

ora disinstalliamo MySQL con il seguenti comandi
apt-get remove mysql-server mysql-client mysql-common
apt-get autoremove

Aggiungiamo il le chiavi per il repository inviando questo comando
apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A

successivamente aggiungiamo al file /etc/apt/sources.list le seguenti linee
deb http://repo.percona.com/apt VERSIONE main
deb-src http://repo.percona.com/apt VERSIONE main

Al posto di VERSIONE dovremo inserire il nome della distro. Possiamo verificarla con
lsb_release -c

Proseguendo blocchiamo l’aggiornamento dalla repository principale
touch /etc/apt/preferences.d/00percona.pref
e incolliamo dentro

Package: *
Pin: release o=Percona Development Team
Pin-Priority: 1001

Ok! Siamo pronti per installare Percona MySQL. facciamo attenzione ad installare la stessa versione di MySQL che abbiamo rimosso. Ad esempoio 5.5 o 5.6. Ad esempio se abbiamo rimosso la 5.5, installiamo il pacchetto percona-server-server-5.5

apt-get update
apt-get install percona-server-server-5.5

In caso di una nuova installazione dobbiamo lanciare anche il comando
/usr/bin/mysql_secure_installation

Ora lanciamo di nuovo il demone MySQL con il comando
service mysql start

Passiamo alla configurazione del file my.cnf. Per un server con 1GB di ram, potrebbe andar bene questo esempio di my.cnf

# Generated by Percona Configuration Wizard (http://tools.percona.com/) version REL5-20120208
[mysql]

# CLIENT #
# Configure default options for clients
port                           = 3306

[mysqld]

# GENERAL #
# Choose user for execution, default storage engine and location of the PID file
user                           = mysql
default-storage-engine         = InnoDB
pid-file                       = /var/lib/mysql/mysql.pid

# MyISAM #
# Setup MyISAM options with a minimal config, as InnoDB is our default engine
key-buffer-size                = 32M
myisam-recover                 = FORCE,BACKUP

# SAFETY #
# Enforce limits and safety checks
max-allowed-packet             = 16M
max-connect-errors             = 1000000
innodb                         = FORCE

# DATA STORAGE #
# Select location for database files
datadir                        = /var/lib/mysql/

# BINARY LOGGING #
# Enable and setup the binary log
log-bin                        = /var/lib/mysql/mysql-bin
expire-logs-days               = 14
sync-binlog                    = 1

# CACHES AND LIMITS #
# Configure reasonable default limits throughout Percona Server
tmp-table-size                 = 32M
max-heap-table-size            = 32M
query-cache-type               = 0
query-cache-size               = 0
max-connections                = 500
thread-cache-size              = 50
open-files-limit               = 65535
table-definition-cache         = 1024
table-open-cache               = 2048

# INNODB #
# Setup InnoDB/XtraDB engine a 300MB buffer pool and 32MB log file size
innodb-flush-method            = O_DIRECT
innodb-log-files-in-group      = 2
innodb-log-file-size           = 32M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table          = 1
innodb-buffer-pool-size        = 300M

# LOGGING #
# Setup log file locations for error log and slow log
# Slow log may be disabled on production setups to prevent extra IO
log-error                      = /var/lib/mysql/mysql-error.log
log-queries-not-using-indexes  = 1
slow-query-log                 = 1
slow-query-log-file            = /var/lib/mysql/mysql-slow.log