To install or upgrade to MySQL 5.7.2, be sure to read the special instructions at the end of this section.
The recommended way to install MySQL on RPM-based Linux distributions is by using the RPM packages. The RPMs
that we provide to the community should work on all versions of Linux that support RPM packages and use
glibc 2.3. To obtain RPM packages, see Section
2.1.3, "How to Get MySQL".
For non-RPM Linux distributions, you can install MySQL using a
See Section 2.2, "Installing MySQL on
Unix/Linux Using Generic Binaries".
Installations created from our Linux RPM distributions result in files under the system directories shown in the following table.
Table 2.9. MySQL Installation Layout for Linux RPM Packages
|Directory||Contents of Directory|
||Client programs and scripts|
||The mysqld server|
||Log files, databases|
||Manual in Info format|
||Unix manual pages|
||Include (header) files|
||Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for databaseinstallation|
RPM distributions of MySQL are also provided by other vendors. Be aware that they may differ from those built by us in features, capabilities, and conventions (including communication setup), and that the instructions in this manual do not necessarily apply to installing them. The vendor's instructions should be consulted instead. Because of these differences, RPM packages built by us check whether such RPMs built by other vendors are installed. If so, the RPM does not install and produces a message explaining this.
In most cases, you need to install only the
packages to get a functional MySQL installation. The other packages are not required for a standard
New RPM install operations (not upgrades) invoke mysql_install_db with the
option that provides for more secure MySQL installation. Invoking mysql_install_db with
--random-passwords causes it to assign a random password to the MySQL
root accounts, set the "password expired"
flag for those accounts, and remove the anonymous-user MySQL accounts. It will be necessary after installation
to start the server, connect as
root using the password written to the
$HOME/.mysql_secret file, and assign a new
password. Until this is done,
root cannot do anything else. This must be done for
root account you intend to use. To change the password, you can use the
SET PASSWORD statement (for example, with the mysql client). You can also use mysqladmin or mysql_secure_installation. For additional details, see Section 4.4.3, "mysql_install_db
— Initialize MySQL Data Directory". (Install operations using RPMs for Unbreakable Linux Network are
unaffected because they do not use mysql_install_db.)
For upgrades, if your installation was originally produced by installing multiple RPM packages, it is best to upgrade all the packages, not just some. For example, if you previously installed the server and client RPMs, do not upgrade just the server RPM.
If you get a dependency failure when trying to install MySQL packages (for example,
removing these packages would break dependencies: libmysqlclient.so.10 is needed by ...), you should also
MySQL-shared-compat package, which includes the shared libraries for
older releases for backward compatibility.
The RPM packages shown in the following list are available. The names shown here use a suffix of
.glibc23.i386.rpm, but particular packages can have different suffixes, described
The MySQL server. You need this unless you only want to connect to a MySQL server running on another machine.
The standard MySQL client programs. You probably always want to install this package.
The libraries and include files that are needed if to compile other MySQL clients, such as the Perl modules. Install this RPM if you intend to compile C API applications.
This package contains the shared libraries (
certain languages and applications need to dynamically load and use MySQL. It contains
single-threaded and thread-safe libraries. Install this RPM if you intend to compile or run C API
applications that depend on the shared client library.
This package includes the shared libraries for older releases, but not the libraries for the current release. It contains single-threaded and thread-safe libraries. 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.
MySQL-shared-compat RPM package enables users of Red Hat-provided
mysql-*-5.1 RPM packages to migrate to Oracle-provided
MySQL-shared-compat replaces the Red Hat
package by replacing
libmysqlclient.so files of the latter package,
thus satisfying dependencies of other packages on
change affects only users of Red Hat (or Red Hat-compatible) RPM packages. Nothing is different for
users of Oracle RPM packages.
The embedded MySQL server library.
This package includes the MySQL test suite.
This contains the source code for all of the previous packages. It can also be used to rebuild the RPMs on other architectures (for example, Alpha or SPARC).
The suffix of RPM package names (following the
VERSION value) has the
indicate the type of system for which the package is built.
indicates the platform and
CPU indicates the processor type or family.
All packages are dynamically linked against
glibc 2.3. The
value indicates whether the package is platform independent or intended for a specific platform, as shown in the
Table 2.10. MySQL Linux Installation Packages
||Platform independent, should run on any Linux distribution that supports
||Red Hat Enterprise Linux 4 or 5|
||Enterprise Linux 6|
||SuSE Linux Enterprise Server 10 or 11|
In MySQL 5.7, only
glibc23 packages are available currently.
CPU value indicates the processor type or family for which the
package is built.
Table 2.11. MySQL Installation Packages for Linux CPU Identifiers
||Intended Processor Type or Family|
||Pentium processor or better, 32 bit|
||64-bit x86 processor|
||Itanium (IA-64) processor|
To see all files in an RPM package (for example, a
MySQL-server RPM), run a command
rpm -qpl MySQL-server-
To perform a standard minimal installation, install the server and client RPMs:
rpm -i MySQL-server-shell>
rpm -i MySQL-client-
To install only the client programs, install just the client RPM:
rpm -i MySQL-client-
RPM provides a feature to verify the integrity and authenticity of packages before installing them. To learn
more about this feature, see Section
2.1.4, "Verifying Package Integrity Using MD5 Checksums or
The server RPM places data under the
/var/lib/mysql directory. The RPM also
creates a login account for a user named
mysql (if one does not exist) to use for
running the MySQL server, and creates the appropriate entries in
start the server automatically at boot time. (This means that if you have performed a previous installation and
have made changes to its startup script, you may want to make a copy of the script so that you do not lose it
when you install a newer RPM.) See Section
126.96.36.199, "Starting and Stopping MySQL Automatically", for more information on how MySQL can be started
automatically on system startup.
In MySQL 5.7, during a new installation, the server boot scripts are installed, but the MySQL server is not started at the end of the installation, since the status of the server during an unattended installation is not known.
In MySQL 5.7, during an upgrade installation using the RPM packages, if the MySQL server is running when the upgrade occurs, the MySQL server is stopped, the upgrade occurs, and the MySQL server is restarted. If the MySQL server is not already running when the RPM upgrade occurs, the MySQL server is not started at the end of the installation.
If something goes wrong, you can find more information in the binary installation section. See Section 2.2, "Installing MySQL on Unix/Linux Using Generic Binaries".
The accounts that are listed in the MySQL grant tables initially have no passwords. After starting the server, you should set up passwords for them using the instructions in Section 2.10, "Postinstallation Setup and Testing".
During RPM installation, a user named
mysql and a group named
mysql are created on the system. This is done using the useradd, groupadd, and
usermod commands. Those commands require appropriate
administrative privileges, which is required for locally managed users and groups (as listed in the
/etc/group files) by the RPM
installation process being run by
If you log in as the
mysql user, you may find that MySQL displays "Invalid (old?) table or database name" errors that
.viminfo, and similar files created by MySQL or operating system utilities. You
can safely ignore these error messages or remove the files or directories that cause them if you do not need
For nonlocal user management (LDAP, NIS, and so forth), the administrative tools may require additional authentication (such as a password), and will fail if the installing user does not provide this authentication. Even if they fail, the RPM installation will not abort but succeed, and this is intentional. If they failed, some of the intended transfer of ownership may be missing, and it is recommended that the system administrator then manually ensures some appropriate user and group exists and manually transfers ownership following the actions in the RPM spec file.
In MySQL 5.7.2, the RPM spec file has been updated, which has the following consequences:
For a non-upgrade installation (no existing MySQL version installed), it possible to install MySQL using yum.
For upgrades, it is necessary to clean up any earlier MySQL installations. In effect, the update is performed by removing the old installations and installing the new one.
Additional details follow.
For a non-upgrade installation of MySQL 5.7.2, it is possible to install using yum:
yum install MySQL-server-
For upgrades to MySQL 5.7.2, the upgrade is performed by removing the old installation and installing the new one. To do this, use the following procedure:
Remove the existing 5.7.
OLDVERSION is the version to remove.
rpm -e MySQL-server-
Repeat this step for all installed MySQL RPMs.
Install the new version.
the version to install.
rpm -ivh MySQL-server-
Alternatively, the removal and installation can be done using yum:
yum remove MySQL-server-shell>
yum install MySQL-server-