• 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

This Article Has Been Shared 889 Times!

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

  • How to Upload Backup to Dropbox from Cloud Server

    Here is How to Upload Backup to Dropbox from Cloud Server in Case You Want To Keep Your Backup of Files and Database on a Free Cloud Storage.

  • Steps To Install Nginx Plus on Ubuntu Server (HP Cloud)

    Here Are the Steps To Install Nginx Plus on Ubuntu Server Running on HP Cloud. Nginx Plus is the Paid Version of Nginx with Extra Features.

  • Install Apache Drill on Ubuntu 16.04 LTS Single Cloud Server

    Drill is SQL Query Engine for Hadoop, NoSQL, Cloud Storage. Here is How to Install Apache Drill on Ubuntu 16.04 LTS Single Cloud Server.

  • How To Set Up rsnapshot For Backup Of WordPress on Cloud Server/VPS

    rsnapshot Once Set, Can Automatically Incrementally Backup. Here is How To Set Up rsnapshot For Backup Of WordPress on Cloud Server/VPS.

  • Ondřej Surý’s PPA For Ubuntu 18.04 LTS LAMP, LEMP : Current Status

    Before Upgrade, We Need to Check Resources, Incompatibilities and Needed Changes in Settings. Here is Current Status of Ondřej Surý’s PPA For Ubuntu 18.04 LTS For Setup of LAMP, LEMP Server.

Additionally, 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

  • Is it Good to Run Apache Web server and MySQL Database on Separate Cloud Servers? March 27, 2023
  • Advantages of Cloud Server Over Dedicated Server for Hosting WordPress March 26, 2023
  • Get Audiophile-Grade Music on Your Smartphone March 25, 2023
  • Simple Windows Security and Privacy Checklist for 2023 March 24, 2023
  • 7 Best Artificial Intelligence (AI) Software March 24, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Steps to Install Percona MySQL Server on Ubuntu 18.04 LTS," in The Customize Windows, May 23, 2018, March 28, 2023, https://thecustomizewindows.com/2018/05/steps-to-install-percona-mysql-server-on-ubuntu-18-04-lts/.

Source:The Customize Windows, JiMA.in

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT