• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Steps to Install Percona MySQL Server on Ubuntu 18.04 LTS

By Abhishek Ghosh May 23, 2018 9:05 pm Updated on May 23, 2018

Steps to Install Percona MySQL Server on Ubuntu 18.04 LTS

Advertisement

At the time of writing, Ubuntu 18.04 LTS is relatively newer. Those who are using Ubuntu 16.04 LTS, eventually will need to upgrade to Ubuntu 18.04 LTS. Here is the Tested Steps to Install Percona MySQL Server on Ubuntu 18.04 LTS For Cloud Server, VPS and Dedicated Server. If you are reading this guide many months after publication, you should check the URLs of the repository mentioned in our guide to grab the latest version.

 

Steps to Install Percona MySQL Server on Ubuntu 18.04 LTS

 

We have the official Percona Apt repo here :

Vim
1
https://repo.percona.com/apt/

At the time of publication of this guide, bottom of the list contains :

Advertisement

---

Vim
1
2
3
4
5
6
7
8
...
percona-release_0.1-6.artful_all.deb               21-May-2018 15:36                7582
percona-release_0.1-6.bionic_all.deb               21-May-2018 15:37                7628
percona-release_0.1-6.jessie_all.deb               21-May-2018 15:36                7832
percona-release_0.1-6.stretch_all.deb              21-May-2018 15:39                7602
percona-release_0.1-6.trusty_all.deb               21-May-2018 15:36                7554
percona-release_0.1-6.wheezy_all.deb               21-May-2018 15:39                7774
percona-release_0.1-6.xenial_all.deb               21-May-2018 15:36                7566

0.1-6 is a required number for now. We have to fetch the repository packages from Percona’s that repo using that number :

Vim
1
wget https://repo.percona.com/apt/percona-release_0.1-6.$(lsb_release -sc)_all.deb

Thereafter, we have to install the downloaded package with dpkg :

Vim
1
dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb

If we run a cat on /etc/apt/sources.list.d/percona-release.list, we can see the content :

Vim
1
cat /etc/apt/sources.list.d/percona-release.list

That should show the Percona repositories as added. Next, we will install Percona Server 5.7 :

Vim
1
2
sudo apt-get update
sudo apt-get install percona-server-server-5.7

During installation, installation will ask to provide a password for root user of Percona MySQL. We can perform apt-pinning by creating a file :

Vim
1
nano /etc/apt/preferences.d/00percona.pref

Copy-pasting this content :

Vim
1
2
3
Package: *
Pin: release o=Percona Development Team
Pin-Priority: 1001

… and saving the file. That will prevent conflicting upgrades from Ubuntu distribution repository. Then, we will run this command :

Vim
1
sudo mysql_secure_installation

sudo mysql_secure_installation needed to ensure security.

Vim
1
2
3
4
5
6
7
8
...
Would you like to setup VALIDATE PASSWORD plugin : N
Change the password for root : N
Remove anonymous users? : Y
Disallow root login remotely? : (If you need to access from other server or your computer, only then yes. Yes is less secured)
Remove test database and access to it? : Y
Reload privilege tables now? : Y
...

Steps to Install Percona MySQL Server on Ubuntu 18-04 LTS

Now login to MySQL server and run the commands specific for Percona (you’ll see they are instructed to run) :

Vim
1
2
3
4
5
6
7
8
9
mysql -u root -p
# run after login
CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_udf.so';
CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so';
CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME 'libmurmur_udf.so';
# you should exit
exit
# then restart mysql
service mysql restart

We ran the above Percona Server is distributed with several User Defined Function from Percona Toolkit, see :

Vim
1
http://www.percona.com/doc/percona-server/5.7/management/udf_percona_toolkit.html

Login an create an user named yourserver2018, with password BADPASSWORD__a&ET# :

Vim
1
2
3
4
5
6
7
mysql -u root -p  
CREATE USER 'yourserver2018'@'localhost' IDENTIFIED BY 'BADPASSWORD__a&ET#';
CREATE DATABASE wordpress2018;
GRANT SELECT,DELETE,INSERT,UPDATE ON wordpress2018.* TO 'yourserver2018'@'localhost';
## OR ##
GRANT ALL PRIVILEGES ON wordpress2018.* TO 'yourserver2018'@'localhost';
FLUSH PRIVILEGES;

Check :

Vim
1
2
3
show databases;
use information_schema;
show tables;

Happy?

Now exit :

Vim
1
exit

Open /etc/mysql/my.cnf and add this stanza above !includedir /etc/mysql/conf.d/ lines :

Vim
1
2
3
4
5
6
[mysqld_safe]
pid–file        = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
nice = 0
log_error=/var/log/mysqld.log
datadir=/var/lib/mysql

Save the file. Restart MySQL :

Vim
1
2
3
4
touch /var/log/mysqld.log
service mysql restart
service mysql status
cat /var/log/mysqld.log

Change the permission of /var/log/mysqld.log to make it writable :

Vim
1
chmod 777 /var/log/mysqld.log

Above will prevent failure to auto-restart MySQL on need. That is one reason why WordPress front throws infamous can not connect database error demanding manual restart.

 

Advanced : Creating debian-sys-maint User for Percona MySQL

 

Ubuntu installation does not automatically create debian-sys-maint user. That user coded to be the control scripts of Percona Server mysqld and mysqld_safe services. Creating this user is needed to have automatic restart of MySQL server specially for WordPress like PHP-MySQL web application. If the user is not present, upon failure to auto-restart; WordPress front will throw infamous Can not connect database error demanding manual restart.

To clarify, Debian has a debian-sys-maint which is used for checking status. The password for that user should be the same as stored in /etc/mysql/debian.cnf.

The user related password could be kept under this directory or Percona :

Vim
1
/etc/mysql/percona-server.conf.d

If you run ls -al, you’ll see two files there :

Vim
1
mysqld.cnf  mysqld_safe.cnf

I believe that I have shortcut to hard-work with a script :

Vim
1
https://gist.github.com/AbhishekGhosh/1abc7680b5679510929ae2cf9d1717ef

Assuming it is fresh installation, you have to run these :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# just create en empty file
touch /etc/mysql/debian.cnf
cd ~
# wget my script
wget https://gist.githubusercontent.com/AbhishekGhosh/1abc7680b5679510929ae2cf9d1717ef/raw/bcb8760b616afb38ab07037578a796ed1a8f7dca/debian-sys-maint.sh
# execute it
ls - al
chmod +x debian-sys-maint.sh
sh debian-sys-maint.sh
## you'll prompted to supply MySQL root password
# check what is created
cat /etc/mysql/percona-server.conf.d/90-mysqladmin.cnf
cp /etc/mysql/percona-server.conf.d/90-mysqladmin.cnf /etc/mysql/debian.cnf
# mysql should not have error on restart out of the way
service mysql restart
service mysql status

Running cat on any of those files – /etc/mysql/debian.cnf or /etc/mysql/percona-server.conf.d/90-mysqladmin.cnf will give you the password :

Vim
1
2
3
4
5
[mysqladmin]
host     = localhost
user     = debian-sys-maint
password = SaXHChx4gGwGrVQe
socket   = /var/run/mysqld/mysqld.sock

Then check login as debian-sys-maint :

Vim
1
mysql -u debian-sys-maint -p

Exit.

Check the function :

Vim
1
sudo /etc/init.d/mysql restart

That should go well. The script deliberately not made full automated. Someone can have real settings files there.

 

How to Remove/Uninstall Percona MySQL 5.7

 

These are not written properly on docs. Run :

Vim
1
2
sudo service mysql stop
sudo apt-get remove percona-server-server-5.7*

If you want to remove everything (including logs) then :

Vim
1
sudo apt-get purge percona-server-server-5.7*

The command is percona-server-server-5.7* not percona-server*. If you run :

Vim
1
sudo apt-get remove percona-server*

It will say there is no such package for particular Ubuntu version.

Tagged With how to install mysql 5 7 on ubuntu 18 04 , mysql ubuntu 18 04 , install percona server on ubuntu , https://www wikihow com/Use-LinkedIn yandex ru , https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1832 -FpXm6WZrAb15ebQr2YrXcjOETB1QPedBCNJrtfyB5n8PHPLT9JYCH8P3KT5KsyZ 875f316c72fd843fe993be6aacaf36cb668bda0f&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme , https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1829 B-S3XfD0neTCg0GhaR_gItomrSVAkQuu0Kda8pmbqxSaOyOSCfhQX0aAZ5VHs1nL 25bde24a3dcdc7045a935c81f17979320c7e3c4b&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme , windows mysql conf , https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1826 kMY2bhLNnr-G3H4zTPoUghOBRj7fTRj51r9WMaK40NAJdm7o43nHiDt1L3abLErO 50858ae4c8b5533603df8f5ef1dbaa848a75797c&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme , https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1825 Y55WHsoIihM6EarEUGlMqHfZ7DkoOxQ7ctV6wKniLybNggmXPMYy18VSDi3aaFf7 6e96e956944a80e5c1edad596f08327f00884087&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme , how to customize mysql ubuntu
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Steps to Install Percona MySQL Server on Ubuntu 18.04 LTS

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • How to Install WordPress : Ubuntu 16.04, Nginx, PHP7-FPM

    Here is Step by Step Guide on How to Install WordPress on Ubuntu 16.04, Nginx, PHP7-FPM, memcached & Percona MySQL 5.7 on Cloud Server or VPS.

  • Install Elastic Stack on Ubuntu 16.04, CentOS 7 Single Cloud Server

    Here is How to Install Elastic Stack on Ubuntu 16.04, CentOS 7 on Single Cloud Server Instance For Server Log Analysis, Big Data Processing.

  • MySQL Configuration to Set Up Master-Slave Replication

    Master-Slave Replication For WordPress Makes it Fail Proof to WordPress Database Errors Making the Website Fully Unreadable.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy