Upgrading MySQL binary or package-based installation on Unix/Linux

王林
Release: 2023-08-28 13:57:03
forward
522 people have browsed it

在 Unix/Linux 上升级 MySQL 二进制或基于包的安装

Let’s learn how to upgrade MySQL binary and package-based installations in Unix or Linux. This can be done in-place or using the logical upgrade method. Let us briefly understand these two methods -

In-place upgrade

  • In-place upgrade involves shutting down the old MySQL server and replacing the old MySQL binaries or packages Replace with new ones.

  • After completing this operation, the MySQL server will be restarted on the existing data directory.

  • After this, the remainder of the existing installation (that requires some kind of upgrade) will be upgraded.

  • For some Linux platforms, MySQL installation from RPM or Debian packages will Includes "systemd" support to help manage MySQL server startup and shutdown.

  • The command "mysqld_safe" will not be installed on such systems.

    li>

Logical upgrade

  • Logical upgrade involves exporting SQL from an old MySQL instance.

  • Existing data needs to be exported from the previous MySQL installation, this can be done using the following command -

mysqldump -u root -p --add-drop-table --routines --events --all-databases --force > data-for-upgrade.sql
Copy after login

Use the following command to close the old MySQL server-

mysqladmin -u root -p shutdown
Copy after login

Use the following command to start a new data directory-

mysqld --initialize --datadir=/path/to/8.0-datadir &
Copy after login

Use the following command to reset the root password-

shell> mysql -u root -p Enter password: **** <− enter temporary root password mysql> ALTER USER USER() IDENTIFIED BY 'your new password';
Copy after login

Use the following command to transfer the previously created directory. Load the storage file into the newly created MySQL server -

mysql -u root -p --force < data-for-upgrade.sql
Copy after login

MySQL cluster upgrade

  • MGM node upgrade.

  • Data node upgrade 1 is upgraded once at a time.

  • API nodes are upgraded one at a time, including the MySQL server.

  • Data dictionary upgrade.

  • System table upgrade.

  • The system restarts.

    li>

The above is the detailed content of Upgrading MySQL binary or package-based installation on Unix/Linux. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!