Replace MySQL with PerconaDB on a Centos server


Percona Server is an enhanced drop-in replacement for MySQL.

Features of PerconaDB
>> Your queries will run faster and more consistently.
>> You will consolidate servers on powerful hardware.
>> You will delay sharding, or avoid it entirely.
>> You will save money on hosting fees and power.
>> You will spend less time tuning and administering.
>> You will achieve higher uptime.
>> You will troubleshoot without guesswork.

Some more,
>> Higher number of INFORMATION_SCHEMA Tables
>> Higher number of Global Performance and Status Counters
>> Per-Index Performance Counters
>> Per-User Performance Counters
>> Per-Client Performance Counters
>> High-Resolution Process List Timing
>> Fast Checksum Algorithm
>> Buffer Pool Pre-Load
>> Support for FlashCache
>> Import Tables From Different Servers

Steps to replace MySQL with Percona
—————

1.First remove the current mysql packages.

# yum remove -y mysql*

2. Create Yum repository for PerconaDB

# vi /etc/yum.repos.d/percona.repo

Add the following entries,

[percona]
name = CentOS $releasever – Percona
baseurl=http://repo.percona.com/centos/$releasever/os/$basearch/
enabled = 1
gpgkey = http://www.percona.com/redir/downloads/percona-release/RPM-GPG-KEY-percona
gpgcheck = 1

3.Remove php from the exclude section of /etc/yum.conf file

4. Install PerconaDB-sever, PerconaDB-client, PerconaDB-devel

# yum install Percona-Server-client-55 Percona-Server-server-55 Percona-Server-devel-55

5.Start MySQL

# /etc/init.d/mysql start

You will get a result like pasted below.

—————-
[root@test csf]# /etc/init.d/mysql start
Starting MySQL (Percona Server).
.. SUCCESS!
[root@test csf]#
—————–

6.Then, run mysql_upgrade

# mysql_upgrade

7. Restart MySQL

# /etc/init.d/mysql restart

Database error: connection failed in roundcube


Issue: I got the above error while accessing round cube.

DATABASE ERROR: CONNECTION FAILED!

Unable to connect to the database!
Please contact your server-administrator

Solution:

Make sure the MySQL password of Roundcube is correct as follows:

root@server[~]$ grep db_dsnw /usr/local/cpanel/base/3rdparty/roundcube/config/db.inc.php

$rcmail_config[‘db_dsnw’] = ‘mysql://roundcube:xyz@localhost/roundcube’;

The password in this case is set in the config as: “xyz”. See if the hash matches what is set for the user:

root@server[~]$ mysql

mysql> use mysql;

mysql> select PASSWORD(‘xyz’);

mysql> select * from user where User = ’roundcube’;

mysql> update user set Password = PASSWORD(‘xyz’) where User = ’roundcube’;

If the above did not fix it, try to update. Update RoundCube.

root@server[~]$ mysqldump roundcube > /path/to/backup.sql

root@server[~]$ /usr/local/cpanel/bin/update-roundcube –force

root@server[~]$ mysql roundcube < /path/to/backup.sql

 

If this not helps please copy the roundcube backup from any of the other server with same cpanel version using scp

first create the sql backup file of /var/lib/mysql/roundcube to /root/roundcube.sql

i.e; mysqldump /var/lib/mysql/roundcube >  /root/roundcube.sql

Then copy it to your server using scp

ie : scp -r -P 2411 /root/roundcube.sql root@198.142.221.132:/root/

Where replace 198.142.221.132 with your server IP

and restore it now

root@server[~]$ mysql roundcube < /root/roundcube.sql

That’s all…….!!!!

Cannot open /var/log/sa/sa07: No such file or directory


Issue : I got this error while running the command “sar -q”

Below is the error that I receive :

root@tricks [~]# sar -q
Cannot open /var/log/sa/sa07: No such file or directory
root@tricks[~]#

Solution :

1. check if service cron is running.

/etc/init.d/crond status

2. If not restart that

/etc/init.d/crond restart

/etc/init.d/syslog restart

3.If still persist, there will be no directory called “sa”, please create it under /var/log/

Please have a try now to run the command “sar -q”

That’s all………..!!!!

 

Configure: error: mcrypt.h not found. Please reinstall libmcrypt


Issue : Configure: error: mcrypt.h not found. Please reinstall libmcrypt

I got the above error while compiling PHP

Solution:

You can install  libmcrypt using the following commands.

# cd /usr/src
# wget ftp://mcrypt.hellug.gr/pub/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz
# tar xvfz libmcrypt-2.5.7.tar.gz
# cd libmcrypt-2.5.7
# ./configure
# make
# make install

That’s all…….!!!!

Fatal error: Invalid opcode 153/1/8


Issue : I got the above error while accessing a Joomla website.

Solution:

The issue is raised due to the incompatibility of eaccelerator with current php version.

So we need to disable eaccelerator for the particular user.

1. Copy the php.ini file to the document root of the user.

2. Then change the following values to “0” instead of “1”

php_flag eaccelerator.enable 0
php_flag eaccelerator.optimizer 0

That’s all……..!!!

quotacheck: Can’t find filesystem to check or filesystem not mounted with quota option


Issue : I got the above error while running the command “/scripts/fixquotas/” in my server

Solution:

1. Login to the vps node

2. Run the following commands.

# vzctl set VPSID –quotaugidlimit 10000 –save

# vzquota off  VPSID

# vzquota on VPSID -s 1

# vzctl restart VPSID

NOTE: “VPSID” must be replaced with corresponding contariner ID (CTID)

3. Now login to the server.

# vzctl enter VPSID

4.Run the follwing commands for user quota calculation:

# quotacheck -acumgv

# /scripts/fixquotas

That’s all……..!!!

Blog Stats

  • 37,402 hits