Перейти к содержимому

Как обновить mysql centos 7

  • автор:

Sorry, you have been blocked

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

What can I do to resolve this?

You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.

Cloudflare Ray ID: 7a28016d9bc624b0 • Your IP: Click to reveal 88.135.219.175 • Performance & security by Cloudflare

Upgrade Mysql 5.7 to MariaDB 10.2 on CentOS7

MariaDB 10.2 on CentOS7

In this article, I’m going to upgrade Mysql5.7 to Mariadb 10.2 on CentOs7 system. This is a simple procedure that yoyu can easly follow.

Login as root user in to your system through SSH.

You can get the current mysql version by running following command.

Now follow the below steps one by one to upgrade to Mariadb10.2

1. Stop mysql service

2. Take the backup of databases.

Be sure to backup MySQL before upgradation process with the following instructions!

3. Remove the existing mysql package from the system.

4. Add MariaDB repository.

And copy the following line to the repsitory file.

Installation of MariaDB can be done by following simple step.

Start MariaDB service.

Run mysql upgrade command

You have succesfully upgraded to mariadb10 and you can verify it by running following command

You will get following as output.

mysql Ver 15.1 Distrib 10.2.23-MariaDB, for Linux (x86_64) using readline 5.1

How to upgrade MySQL & MariaDB on Linux Cloud Servers

MySQL & MariaDB are open-source relational database management systems and are possible to use in most Linux distributions. It uses SQL (Structured Query Language) to manage its data.

This guide outlines the basic steps required to upgrade MySQL and MariaDB on Linux systems.

To upgrade MySQL 5.6 to 5.7 on CentOS 7

Check the current version of MySQL on the server.

upgradedb1

Before initiating the upgrade, take the full backup of all databases that exist on the server with the below command.

Enter the root password and then the all-database.sql will be created under /tmp directory:

upgradedb2

Stop MySQL service with the below command.

upgradedb3

Now create the backup of the current MySQL data with the below command.

upgradedb4

Download the MySQL RPM which needs to upgrade. Here downloading the MySQL 5.7 RPM to /tmp directory with the below command.

List the /tmp directory on the server to verify whether it downloaded.

upgradedb5

Now need to remove the MySQL-Community RPM that contains the current version of MySQL 5.6.

upgradedb6

Install the recently downloaded MySQL 5.7 RPM/

upgradedb7

Update the MySQL repository to the recently installed 5.7.

upgradedb8

Now restart the MySQL service and check the version with the below commands.

upgradedb9

Here from the last image, you can verify that the MySQL service upgraded from 5.6 to 5.7.

To upgrade MySQL 5.7 to 8.0 on Ubuntu/Debian

Check the current version of the MySQL on the server

upgradedb10

Before initiating the upgrade, take the full backup of all databases that exist on the server with the below command.

Enter the root password and then the all-database.sql will be created under /tmp directory:

upgradedb11

Stop MySQL service with the below command.

upgradedb12

Now create the backup of the current MySQL data with the below command.

upgradedb13

Now download the MySQL APT repository.

upgradedb14

Then add the MySQL APT repository to the server’s software repository list with the below command.

The below screens will get and select the MySQL Server & Cluster option and press enter .

upgradedb15

Now select the mysql-8.0 and press OK .

upgradedb16

Click on the below-mentioned OK to finish.

upgradedb17

Then will get the below message.

upgradedb18

Now update the server and install the latest MySQL using the below commands.

upgradedb19

upgradedb20

Now restart the MySQL service and check the version with the below commands.

upgradedb21

Here from the last image, you can verify that the MySQL service upgraded from 5.7 to 8.0.

To upgrade MariaDB 5.5 to 10.1 on CentOS 7

Check the current version of the MariaDB on the server and Enter the MariaDB root password.

upgradedb22

Before initiating the upgrade, take the full backup of all databases that exist on the server with the below command.

Enter the MariaDB root password and then the all-database.sql will be created under /tmp directory.

upgradedb23

Stop MariaDB service with the below command.

upgradedb24

Now create the backup of the current MariaDB data with the below command.

upgradedb25

Now need to add the latest MariaDB 10.1 repo for CentOS 7 distributions. For that add the following text in /etc/yum.repos.d/MariaDB10.repo with the text editor vi .

upgradedb26

Now remove the current MariaDB 5.5 from the server with the below command.

upgradedb27

Then remove the repository cache with the below command.

upgradedb28

Now proceed with the Installation MariaDB 10.1.

upgradedb29

Once the installation is completed, start and enable MariaDB.

upgradedb30

Now run the below command to check the new version of MariaDB.

Enter the MariaDB root password.

upgradedb31

Here from the last image, you can verify that the MariaDB server upgraded from 5.5 to 10.1.

To upgrade MariaDB 10.1 to 10.5 on Ubuntu/Debian

Run the below command to check the current version of the MariaDB on the server and Enter the MariaDB root password.

upgradedb32

Before initiating the upgrade, take the full backup of all databases that exist on the server with the below command.

Enter the MariaDB root password and then the all-database.sql will be created under /tmp directory:

upgradedb33

Stop MariaDB service with the below command.

upgradedb34

Now create the backup of the current MariaDB data with the below command.

upgradedb35

Now run the below commands to add the MariaDB PPA on the server.

upgradedb36

upgradedb37

upgradedb38

NOTE: Replace ubuntu bionic with your distribution name and release.

Now remove the current MariaDB 10.1 from the server with the below command.

upgradedb39

Then remove the repository cache with the below command.

upgradedb40

Now proceed with the Installation MariaDB 10.5

upgradedb41

Once the installation is completed, start and enable MariaDB.

upgradedb42

Now run the below command to check the new version of MariaDB.

Enter the MariaDB root password.

upgradedb43

Here from the last image, you can verify that the MariaDB server upgraded from 10.1 to 10.5.

How to Install MySQL 8.0 on RHEL/CentOS 8/7 and Fedora 35

MySQL is an open-source free relational database management system (RDBMS) released under GNU (General Public License). It is used to run multiple databases on any single server by providing multi-user access to each created database.

This article will walk through you the process of installing and updating the latest MySQL 8.0 version on RHEL/CentOS 8/7/6/ and Fedora using MySQL Yum repository via YUM utility.

Step 1: Adding the MySQL Yum Repository

1. We will use the official MySQL Yum software repository, which will provide RPM packages for installing the latest version of MySQL server, client, MySQL Utilities, MySQL Workbench, Connector/ODBC, and Connector/Python for the RHEL/CentOS 8/7/6/ and Fedora 30-35.

Important: These instructions only work on a fresh installation of MySQL on the server, if there is already a MySQL installed using a third-party-distributed RPM package, then I recommend you to upgrade or replace the installed MySQL package using the MySQL Yum Repository”.

Before Upgrading or Replacing an old MySQL package, don’t forget to take all important database backup and configuration files using our Backup MySQL Databases guide.

2. Now download and add the following MySQL Yum repository to your respective Linux distribution system’s repository list to install the latest version of MySQL (i.e. 8.0 released on 27 July 2018).

3. After downloading the package for your Linux platform, now install the downloaded package with the following command.

The above installation command adds the MySQL Yum repository to the system’s repository list and downloads the GnuPG key to verify the integrity of the packages.

4. You can verify that the MySQL Yum repository has been added successfully by using the following command.

Verify MySQL Yum Repository

Step 2: Installing Latest MySQL Version

5. Install the latest version of MySQL (currently 8.0) using the following command.

The above command installs all the needed packages for MySQL server mysql-community-server, mysql-community-client, mysql-community-common and mysql-community-libs.

Step 3: Installing Different MySQL Release Versions

6. You can also install different MySQL versions using different sub-repositories of MySQL Community Server. The sub-repository for the recent MySQL series (currently MySQL 8.0) is activated by default, and the sub-repositories for all other versions (for example, the MySQL 5.x series) are deactivated by default.

To install a specific version from a specific sub-repository, you can use —enable or —disable options using yum-config-manager or dnf config-manager as shown:

Step 4: Starting the MySQL Server

7. After successful installation of MySQL, it’s time to start and enable the MySQL server with the following commands:

You can verify the status of the MySQL server with the help of the following command.

This is the sample output of running MySQL under my CentOS 7 box.

Check Mysql Status

8. Now finally verify the installed MySQL version using the following command.

Check MySQL Installed Version

Step 5: Securing the MySQL Installation

9. The command mysql_secure_installation allows you to secure your MySQL installation by performing important settings like setting the root password, removing anonymous users, removing root login, and so on.

Note: MySQL version 8.0 or higher generates a temporary random password in /var/log/mysqld.log after installation.

Use the below command to see the password before running MySQL secure command.

Once you know the password you can now run the following command to secure your MySQL installation.

Note: Enter new Root password means your temporary password from a file /var/log/mysqld.log .

Now follow the onscreen instructions carefully, for reference see the output of the above command below.

Sample Output

Step 6: Connecting to MySQL Server

10. Connect to a newly installed MySQL server by providing a username and password.

Sample Output:

Step 7: Updating MySQL with Yum

11. Besides fresh installation, you can also do updates for MySQL products and components with the help of the following command.

Update MySQL Version

When new updates are available for MySQL, it will auto-install them, if not you will get a message saying NO packages marked for updates.

That’s it, you’ve successfully installed MySQL 8.0 on your system. If you’re having any trouble installing feel free to use our comment section for solutions.

Tutorial Feedback.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *