11 Sep MySQL : Installing Percona Server 5.6 on RHEL 6.5
Hey I’m back with another adventure in my career, and due to this I will be digging a bit more into the MySQL world.
So to get me initiated on this, I put myself the task of installing Percona Server 5.6, which is a variant of MySQL that tries to maintain all compatibility to Oracle MySQL, but at the same time providing better performance, or so I’ve been told 🙂
So after doing a RHEL 6.5 installation, the first thing I did was to setup the YUM repository for the Percona install
root@localhost ~]# yum install http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm
Loaded plugins: refresh-packagekit, security
Setting up Install Process
percona-release-0.0-1.x86_64.rpm | 6.1 kB 00:00
Examining /var/tmp/yum-root-3c6w0E/percona-release-0.0-1.x86_64.rpm: percona-release-0.0-1.x86_64
Marking /var/tmp/yum-root-3c6w0E/percona-release-0.0-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package percona-release.x86_64 0:0.0-1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================
Installing:
percona-release x86_64 0.0-1 /percona-release-0.0-1.x86_64 3.6 k
Transaction Summary
==============================================================================================================================================
Install 1 Package(s)
Total size: 3.6 k
Installed size: 3.6 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : percona-release-0.0-1.x86_64 1/1
Verifying : percona-release-0.0-1.x86_64 1/1
Installed:
percona-release.x86_64 0:0.0-1
Complete!
So the next thing I did, was try to do the installation as it was marked on the Percona Installation Web Page, but to my surprise, I couldn’t as I hit the following errors marked in red
[root@localhost ~]# yum install Percona-Server-client-56 Percona-Server-server-56
Loaded plugins: refresh-packagekit, security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package Percona-Server-client-56.x86_64 0:5.6.20-rel68.0.el6 will be installed
...
--> Finished Dependency Resolution
Error: mysql conflicts with Percona-Server-client-56-5.6.20-rel68.0.el6.x86_64
Error: mysql-server conflicts with Percona-Server-server-56-5.6.20-rel68.0.el6.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
So after digging a bit around, I found that my problem was that I had some MySQL libraries already installed, so what I had to do is remove them , also since this is my first try, don’t know if this the correct way to do it, or if it even can be done on a production server, so just tread lightly :
[root@localhost ~]# yum remove mysql-libs
Loaded plugins: refresh-packagekit, security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-libs.x86_64 0:5.1.71-1.el6 will be erased
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: mysql-server-5.1.71-1.el6.x86_64
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: 2:postfix-2.6.6-2.2.el6_1.x86_64
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: redland-1.0.7-11.el6.x86_64
...
---> Package crontabs.noarch 0:1.10-33.el6 will be erased
---> Package sysstat.x86_64 0:9.0.4-22.el6 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================
Removing:
mysql-libs x86_64 5.1.71-1.el6 @anaconda-OracleLinuxServer-201311252058.x86_64/6.5 4.0 M
Removing for dependencies:
akonadi x86_64 1.2.1-2.el6 @anaconda-OracleLinuxServer-201311252058.x86_64/6.5 1.7 M
...
Removed:
mysql-libs.x86_64 0:5.1.71-1.el6
Dependency Removed:
akonadi.x86_64 0:1.2.1-2.el6 cronie.x86_64 0:1.4.4-12.el6 cronie-anacron.x86_64 0:1.4.4-12.el6
crontabs.noarch 0:1.10-33.el6 kcoloredit.x86_64 0:4.3.3-2.el6 kdeaccessibility.x86_64 1:4.3.4-5.el6
kdeaccessibility-libs.x86_64 1:4.3.4-5.el6 kdeadmin.x86_64 7:4.3.4-5.0.1.el6 kdeartwork-screensavers.x86_64 0:4.3.4-7.el6
kdebase.x86_64 6:4.3.4-6.0.1.el6 kdebase-libs.x86_64 6:4.3.4-6.0.1.el6 kdebase-runtime.x86_64 0:4.3.4-9.el6
kdebase-runtime-libs.x86_64 0:4.3.4-9.el6 kdebase-workspace.x86_64 0:4.3.4-24.0.1.el6 kdebase-workspace-libs.x86_64 0:4.3.4-24.0.1.el6
kdegames.x86_64 6:4.3.4-5.el6 kdegames-libs.x86_64 6:4.3.4-5.el6 kdegraphics.x86_64 7:4.3.4-6.el6
kdegraphics-libs.x86_64 7:4.3.4-6.el6 kdelibs.x86_64 6:4.3.4-20.el6_4.1 kdelibs-experimental.x86_64 0:4.3.4-3.el6
kdemultimedia.x86_64 6:4.3.4-3.el6 kdemultimedia-libs.x86_64 6:4.3.4-3.el6 kdenetwork.x86_64 7:4.3.4-11.el6_0.1
kdenetwork-libs.x86_64 7:4.3.4-11.el6_0.1 kdepim.x86_64 6:4.3.4-6.el6 kdepim-libs.x86_64 6:4.3.4-6.el6
kdepim-runtime.x86_64 0:4.3.4-5.el6 kdepim-runtime-libs.x86_64 0:4.3.4-5.el6 kdepimlibs.x86_64 0:4.3.4-4.el6
kdepimlibs-akonadi.x86_64 0:4.3.4-4.el6 kdeplasma-addons.x86_64 0:4.3.4-5.el6 kdeplasma-addons-libs.x86_64 0:4.3.4-5.el6
kdeutils.x86_64 6:4.3.4-7.el6 kdeutils-libs.x86_64 6:4.3.4-7.el6 kdm.x86_64 0:4.3.4-24.0.1.el6
kiconedit.x86_64 0:4.3.3-1.el6 kio_sysinfo.x86_64 0:20090930-1.el6 kipi-plugins.x86_64 0:0.8.0-5.el6
kipi-plugins-libs.x86_64 0:0.8.0-5.el6 kmid.x86_64 0:2.0-0.14.20080213svn.el6 konq-plugins.x86_64 0:4.3.3-5.el6
ksig.x86_64 0:1.1-0.10.20080213.el6 ksshaskpass.x86_64 0:0.5.1-4.1.el6 libcgroup.x86_64 0:0.40.rc1-5.el6
mysql.x86_64 0:5.1.71-1.el6 mysql-server.x86_64 0:5.1.71-1.el6 numad.x86_64 0:0.5-9.20130814git.el6
perl-DBD-MySQL.x86_64 0:4.013-3.el6 postfix.x86_64 2:2.6.6-2.2.el6_1 qt-mysql.x86_64 1:4.6.2-26.el6_4
redhat-lsb.x86_64 0:4.0-7.0.1.el6 redhat-lsb-compat.x86_64 0:4.0-7.0.1.el6 redhat-lsb-core.x86_64 0:4.0-7.0.1.el6
redhat-lsb-graphics.x86_64 0:4.0-7.0.1.el6 redhat-lsb-printing.x86_64 0:4.0-7.0.1.el6 redland.x86_64 0:1.0.7-11.el6
soprano.x86_64 0:2.3.1-1.2.el6 sysstat.x86_64 0:9.0.4-22.el6
Complete!
Now, what I did , just to be on the safe side of what I had removed, is to do an update
[root@localhost ~]# yum update
After this,I was ready to the install of the Percona Server without any issues
[root@localhost ~]# yum install Percona-Server-client-56 Percona-Server-server-56
Loaded plugins: refresh-packagekit, security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package Percona-Server-client-56.x86_64 0:5.6.20-rel68.0.el6 will be installed
...
===========================================================================================================================================
Package Arch Version Repository Size
===========================================================================================================================================
Installing:
Percona-Server-client-56 x86_64 5.6.20-rel68.0.el6 percona 6.4 M
Percona-Server-server-56 x86_64 5.6.20-rel68.0.el6 percona 19 M
Installing for dependencies:
Percona-Server-shared-56 x86_64 5.6.20-rel68.0.el6 percona 720 k
...
Installed:
Percona-Server-client-56.x86_64 0:5.6.20-rel68.0.el6 Percona-Server-server-56.x86_64 0:5.6.20-rel68.0.el6
Dependency Installed:
Percona-Server-shared-56.x86_64 0:5.6.20-rel68.0.el6
Complete!
What I tried to do next was to login, but I faced another error
[root@localhost ~]# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
So now, and this I didn’t know, is that the service had to be started, which was fairly simple
[root@localhost ~]# service mysql start
Starting MySQL (Percona Server). SUCCESS!
Just to be on the safe side as well, I secured the environment as recommended
root@localhost ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
... Success!
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] n
... skipping.
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
Cleaning up...
To finish this exercise , I created an admin user, and in the next step , tried to verify that I was able to login
[oracle@localhost Desktop]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 12
Server version: 5.6.20-68.0 Percona Server (GPL), Release 68.0, Revision 656
Copyright (c) 2009-2014 Percona LLC and/or its affiliates
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE USER 'rene'@'%' IDENTIFIED BY 'oracle';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'rene'@'%' with grant option;
Query OK, 0 rows affected (0.01 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
As you can see below, I was successful in this exercise
[oracle@localhost Desktop]$ mysql -u rene -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 13
Server version: 5.6.20-68.0 Percona Server (GPL), Release 68.0, Revision 656
Copyright (c) 2009-2014 Percona LLC and/or its affiliates
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql> SELECT user, host FROM mysql.user;
+------+-----------+
| user | host |
+------+-----------+
| rene | % |
| root | 127.0.0.1 |
| root | ::1 |
| root | localhost |
+------+-----------+
4 rows in set (0.00 sec)
mysql> SELECT USER(), CURRENT_USER();
+----------------+----------------+
| USER() | CURRENT_USER() |
+----------------+----------------+
| rene@localhost | rene@% |
+----------------+----------------+
1 row in set (0.00 sec)
mysql> SHOW VARIABLES LIKE 'skip_networking';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| skip_networking | OFF |
+-----------------+-------+
1 row in set (0.01 sec)
mysql>
Conclusion
This was just a small exercise of my installation of Percona, though this doesn’t mean it’s the correct one, it does clear a bit of problems that I went through when I was trying to do it, hope this helps you out in your first try outs of this RDBMS
Sorry, the comment form is closed at this time.