MySQL Tutorial

MySQL Installation and Configuration

MySQL Database Operations

Database Design

MySQL Data Types

MySQL Storage Engines

MySQL Basic Operations of Tables

MySQL Constraints

MySQL Operators

MySQL Function

MySQL Manipulate Table Data

MySQL View

MySQL Indexes

MySQL Stored Procedure

MySQL Trigger

MySQL Transactions

MySQL Character Set

MySQL User Management

MySQL Database Backup and Recovery

MySQL Log

MySQL Performance Optimization

Notes on Linux MySQL Packages

There are many distributions of the Linux operating system, and the MySQL versions under different distributions are also different. The main Linux versions supported by MySQL are Red Hat Enterprise Linux and SUSE Linux Enterprise Server. This section mainly introduces the versions supported by MySQL under different Linux distributions.

MySQL packages for Linux operating systems are generally divided into the following three categories:
  • RPM package
  • Binary package
  • Source package

The 3 categories of MySQL packages are described as follows:

1) RPM

The installation and uninstallation of RPM software packages are very convenient, and its Server software and Client software need to be downloaded and installed separately.

2) Binary package

Binary packages are packages that have been compiled when the software is released, and are much faster to install than source packages.

3) Source package

The source package contains the source code of the MySQL database, which needs to be compiled into a binary file by the user before it can be used.

In addition, the MySQL packages of different Linux distributions are also different. Below is a description of the MySQL packages for the two distributions, Red Hat Enterprise Linux and SUSE Linux Enterprise Server.

1) Red Hat Enterprise Linux distribution

Red Hat Enterprise Linux is a product of Red Hat Corporation. Most MySQL packages under Red Hat Enterprise Linux are RPM packages. The versions of the MySQL packages under each Red Hat Enterprise Linux release are different due to the supported processor architectures.

In addition to the RPM package versions, there are MySQL binary and source packages in Red Hat Enterprise Linux. RPM packages, binary packages, and source packages are installed differently. RPM packages are the easiest to install, and source packages are the most flexible.

Readers can choose the Red Hat Enterprise Linux platform to download the server and client on the download page (https://dev.mysql.com/downloads/mysql/).

2) SUSE Linux Enterprise Server distribution

SUSE Linux Enterprise Server is a Linux distribution published and maintained by the German company SuSE Linux AG. The company was acquired by Novell in 2004. Like Red Hat, different versions of MySQL are available on different processor architectures.

Readers can choose the SUSE Linux enterprise Server platform and download the server and client on the download page (https://dev.mysql.com/downloads/mysql/).


Among them, MySQL Server represents the RPM package on the server side, providing users with core MySQL services. Clinet Utilities represents a client-side RPM package, and is a client-side tool for connecting to MySQL services, which is convenient for administrators and developers to perform various management tasks on the server.

Expand

In addition to the above two Linux distributions, there are other Linux distributions, such as the more popular Fedora, Ubuntu, and CentOS.
Below are the commonly used Linux versions and recommended MySQL versions, as shown in the table below.

Linux Version Recommended MySQL version to install
Red Hat Enterprise Linux RPM package
SUSE Linux Enterprise Server RPM package
Fedora RPM package
Ubuntu Source package
CentOS RPM package
If your Linux distribution supports RPM packages, try to choose RPM packages for installation. This method is simple to install and easy to manage.
  1. MySQL Package Management on Ubuntu:

    • Description: Ubuntu uses the apt package manager. To install MySQL, use commands like:
      sudo apt update
      sudo apt install mysql-server
      
  2. MySQL Installation on CentOS Package:

    • Description: CentOS utilizes the yum package manager. Install MySQL with commands like:
      sudo yum install mysql-server
      
  3. Debian MySQL Server Package:

    • Description: Debian, like Ubuntu, uses the apt package manager. Install MySQL with commands like:
      sudo apt update
      sudo apt install mysql-server
      
  4. Managing MySQL Packages on Red Hat:

    • Description: Red Hat systems use yum. Install MySQL with commands like:
      sudo yum install mysql-server
      
  5. Ubuntu MySQL Client Package:

    • Description: For MySQL client tools on Ubuntu, install with:
      sudo apt update
      sudo apt install mysql-client
      
  6. Installing MySQL Server on Arch Linux:

    • Description: Arch Linux uses pacman. Install MySQL server with:
      sudo pacman -S mysql
      
  7. MySQL RPM Package for Linux:

    • Description: MySQL packages for RPM-based systems (such as Red Hat and CentOS) can be obtained from the official MySQL website or repositories. Install using rpm commands.
      sudo rpm -Uvh mysql-community-release.rpm
      sudo yum install mysql-server