Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
MySQL 8 Cookbook

You're reading from   MySQL 8 Cookbook Over 150 recipes for high-performance database querying and administration

Arrow left icon
Product type Paperback
Published in Jan 2018
Publisher
ISBN-13 9781788395809
Length 446 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Karthik Appigatla Karthik Appigatla
Author Profile Icon Karthik Appigatla
Karthik Appigatla
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. MySQL 8 - Installing and Upgrading FREE CHAPTER 2. Using MySQL 3. Using MySQL (Advanced) 4. Configuring MySQL 5. Transactions 6. Binary Logging 7. Backups 8. Restoring Data 9. Replication 10. Table Maintenance 11. Managing Tablespace 12. Managing Logs 13. Performance Tuning 14. Security

Installing MySQL 8.0 using RPM or DEB files

Installing MySQL using repositories requires access to public internet. As a security measure, most of the production machines are not connected to the internet. In that case, you can download the RPM or DEB files on the system administration and copy them to the production machine.

There are mainly two types of installation files:

  • RPM (CentOS, Red Hat, Fedora, and Oracle Linux)
  • DEB (Debian, Ubuntu)

There are multiple packages that you need to install. Here is a list and short description of each one:

  • mysql-community-server: Database server and related tools.
  • mysql-community-client: MySQL client applications and tools.
  • mysql-community-common: Common files for server and client libraries.
  • mysql-community-devel: Development header files and libraries for MySQL database client applications, such as the Perl MySQL module.
  • mysql-community-libs: The shared libraries (libmysqlclient.so*) that certain languages and applications need to dynamically load and use MySQL.
  • mysql-community-libs-compat: The shared libraries for older releases. Install this package if you have applications installed that are dynamically linked against older versions of MySQL but you want to upgrade to the current version without breaking the library dependencies.

How to do it...

Let's look at how to do it using the following types of bundles:

Using the RPM bundle

  1. Download the MySQL RPM tar bundle from the MySQL Downloads page, http://dev.mysql.com/downloads/mysql/, choosing your OS and CPU architecture. At the time of writing,  MySQL 8.0 is not GA. If it is still in the development series, select the Development Releases tab for getting MySQL 8.0 and the choose the OS and version:
shell> wget 'https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.3-0.1.rc.el7.x86_64.rpm-bundle.tar'
~
Saving to: ‘mysql-8.0.3-0.1.rc.el7.x86_64.rpm-bundle.tar’
~
  1. Untar the package:
shell> tar xfv mysql-8.0.3-0.1.rc.el7.x86_64.rpm-bundle.tar
  1. Install MySQL:
shell> sudo rpm -i mysql-community-{server-8,client,common,libs}*
  1. RPM cannot solve the dependency issues and the installation process might run issues. If you are facing such issues, use the yum command listed here (you should have access to dependent packages):
shell> sudo yum install mysql-community-{server-8,client,common,libs}* -y
  1. Verify the installation:
shell> rpm -qa | grep -i mysql-community
mysql-community-common-8.0.3-0.1.rc.el7.x86_64
mysql-community-libs-compat-8.0.3-0.1.rc.el7.x86_64
mysql-community-libs-8.0.3-0.1.rc.el7.x86_64
mysql-community-server-8.0.3-0.1.rc.el7.x86_64
mysql-community-client-8.0.3-0.1.rc.el7.x86_64

Using the APT bundle

  1. Download the MySQL APT TAR from the MySQL Downloads page, http://dev.mysql.com/downloads/mysql/:
shell> wget "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-server_8.0.3-rc-1ubuntu16.04_amd64.deb-bundle.tar"
~
Saving to: ‘mysql-server_8.0.3-rc-1ubuntu16.04_amd64.deb-bundle.tar’
~
  1. Untar the packages:
shell> tar -xvf mysql-server_8.0.3-rc-1ubuntu16.04_amd64.deb-bundle.tar 
  1. Install the dependencies. You may need to install the libaio1 package if it is not already installed:
shell> sudo apt-get install -y libaio1
  1. Upgrade libstdc++6 to the latest:
shell> sudo add-apt-repository ppa:ubuntu-toolchain-r/test
shell> sudo apt-get update
shell> sudo apt-get upgrade -y libstdc++6
  1. Upgrade libmecab2 to the latest. If universe is not included, then add the following line to the end of the file (for example, zesty):
shell> sudo vi /etc/apt/sources.list
deb http://us.archive.ubuntu.com/ubuntu zesty main universe

shell> sudo apt-get update
shell> sudo apt-get install libmecab2
  1. Preconfigure the MySQL server package with the following command. It asks you to set the root password:
shell> sudo dpkg-preconfigure mysql-community-server_*.deb
  1. Install the database common files package, the client package, the client metapackage, the server package, and the server metapackage (in that order); you can do that with a single command:
shell> sudo dpkg -i mysql-{common,community-client-core,community-client,client,community-server-core,community-server,server}_*.deb
  1. Install the shared libraries:
shell> sudo dpkg -i libmysqlclient21_8.0.1-dmr-1ubuntu16.10_amd64.deb
  1. Verify the installation:
shell> dpkg -l | grep -i mysql
ii mysql-client 8.0.3-rc-1ubuntu14.04 amd64 MySQL Client meta package depending on latest version
ii mysql-common 8.0.3-rc-1ubuntu14.04 amd64 MySQL Common
ii mysql-community-client 8.0.3-rc-1ubuntu14.04 amd64 MySQL Client
ii mysql-community-client-core 8.0.3-rc-1ubuntu14.04 amd64 MySQL Client Core Binaries
ii mysql-community-server 8.0.3-rc-1ubuntu14.04 amd64 MySQL Server
ii mysql-community-server-core 8.0.3-rc-1ubuntu14.04 amd64 MySQL Server Core Binaires
ii mysql-server 8.0.3-rc-1ubuntu16.04 amd64 MySQL Server meta package depending on latest version
You have been reading a chapter from
MySQL 8 Cookbook
Published in: Jan 2018
Publisher:
ISBN-13: 9781788395809
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image