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 administrationand 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.
Let's look at how to do it using the following types of bundles:
- 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 theDevelopment 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’
~
- Untar the package:
shell> tar xfv mysql-8.0.3-0.1.rc.el7.x86_64.rpm-bundle.tar
- Install MySQL:
shell> sudo rpm -i mysql-community-{server-8,client,common,libs}*
- 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
- 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
- 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’ ~
- Untar the packages:
shell> tar -xvf mysql-server_8.0.3-rc-1ubuntu16.04_amd64.deb-bundle.tar
- Install the dependencies. You may need to install the
libaio1
package if it is not already installed:
shell> sudo apt-get install -y libaio1
- 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
- Upgrade
libmecab2
to the latest. Ifuniverse
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
- 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
shell> sudo dpkg -i mysql-{common,community-client-core,community-client,client,community-server-core,community-server,server}_*.deb
- Install the shared libraries:
shell> sudo dpkg -i libmysqlclient21_8.0.1-dmr-1ubuntu16.10_amd64.deb
- 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