Home  >  Article  >  Database  >  How to upgrade mysql with APT

How to upgrade mysql with APT

醉折花枝作酒筹
醉折花枝作酒筹forward
2021-07-05 10:11:202106browse

Upgrade mysql Before upgrading mysql, you must back up mysql. In addition, it is assumed that the original mysql is installed using the APT warehouse. If it is not installed in this way, you need to replace the mysql that comes with the third-party system or replace the mysql installed with the deb package.

How to upgrade mysql with APT

Upgrade mysql

Use the MYSQL APT warehouse to upgrade MYSQL (that is, replace the old version and run the new version with the original data), use the following steps:

  1. Make sure your software repository list includes the MySQL APT repository.

  2. Run the following command to ensure you have the latest package information in your MySQL APT repository.

apt-get update

3. Note that by default, MYSQL can only be updated to the version selected when adding the APT warehouse. If you want to update to other versions, please refer to Selecting a Release Version.

4. Use the following command to upgrade mysql.

apt-get install mysql-server

The command to upgrade other ancillary products and components is:

apt-get install package-name

View usage To install ancillary products and components from the MYSQL APT warehouse, use the following command:

dpkg -l | grep mysql | grep ii

5. After the upgrade is completed, mysql will usually be restarted, MySQL 8.0. For versions before 16, run mysql_upgrade after restarting to check whether the old version data is compatible with the new version.

As a general rule, upgrades should be made from one version to the next, rather than directly to the latest version. For example, upgrading from 5.5 to 5.6, and then to 5.7 should not be upgraded to 5.7 in one step.

Replace the mysql that comes with the third-party system

Note: The MySQL APT warehouse can only replace the mysql that comes with Debian and Ubuntu, and cannot replace other mysql branches inside or outside the version library. In order to replace these MySQL branches, you must first uninstall the MySQL that comes with the system. You must obtain from the publisher how to uninstall the MySQL that comes with the system, backup the data, and how to restore the backup data to the new MySQL.

Some third-party built-in warehouse packages rely on the original built-in mysql package, and MySQL APT repository packages should not work with them. These include akonadi-backend-mysql, handlersocket-mysql-5.5, and zoneminder.

Use the following steps to replace the third-party system:

  • Back up your database.

  • Add APT repository and select a release series.

  • Run step 4 above to replace the original version that comes with the system.

After replacing the native distribution of MySQL with the MySQL APT repository, use the APT get purge, APT get remove --purge or dpkg -P command to purge the old one from the native repository MySQL packages may affect newly installed MySQL servers in various ways. Therefore, do not purge old MySQL packages from native repository packages.

  • Restore data

Replace the mysql installed with the downloaded deb package

From https://dev.mysql The deb package at .com/downloads/ is different from the deb package from the MySQL APT repository. There are different ways to install and configure mysql.

The following describes how to replace mysql installed with the deb package from https://dev.mysql.com/downloads/.

  • Back up your database.

  • Add APT repository and select a release series.

  • Use the following command to delete the old version.

dpkg -P mysql

  • Use the following command to install mysql

apt-get install mysql-server

  • Restore data.

Delete mysql using APT

To delete the mysql server and components installed using the MySQL APT warehouse, first delete the mysql server using the following command:

apt-get remove mysql-server

Then delete the software automatically installed with mysql server:

apt-get autoremove

Use the following command to delete ancillary products and components, replace package-name with the name of the package you want to delete:

apt-get remove package-name

Check what you are using For packages installed by MySQL APT repository, use the following command:

dpkg -l | grep mysql | grep ii

Available packages in the MYSQL APT repository

Related learning recommendations: mysql tutorial(Video)

##mysql-cluster-community-sourceNDB cluster source packagemysql-cluster-community-testNDB Cluster's test suitemysql-community-clientMySQL clientmysql-commonMySQL database common file##libmysqlclient20##libmysqlclient-devlibmysqld-dev##NDB Cluster ClientNDB Cluster Client Development Kit

Package Name

Description

mysql-server

For installing MySQL server

##mysql-community-server

MySQL server

mysql-client

is used to install the MySQL client

mysql-cluster-community-auto-installer

Automatic installer for NDB cluster

mysql-cluster-community-client

NDB Cluster MySQL Client

##mysql-cluster-community-data-node

NDB Cluster data Node

mysql-cluster-community-java

NDB cluster Java driver

mysql-cluster-community-management-server

NDB cluster management node

mysql-cluster-community-memcached

NDB cluster memcached server

mysql-cluster- community-server

NDB Cluster MySQL server

MySQL Database Client Library

MySQL Database Development files

##MySQL embedded database development files

mysql-testsuite
For installing the MySQL test suite

mysql- community-test
MySQL test suite

mysql-community-bench
MySQL Benchmark Suite

mysql-community-source
MySQL source code

mysql-workbench-community
MySQL Workbench (not available for Debian platform)

mysql-connector-python-py3
MySQL Connector/Python for Ubuntu 16.04, 18.04, and 18.10; use Python 3.2 or higher

mysql-connector-python
For Debian 8.x and Python 2.6.3 or higher and for Ubuntu MySQL Connector/Python for 16.04, 18.04, and 18.10; using Python 2.6.3 through 3.1

mysql-router
MySQL Router

##ndbclient

ndbclient-dev

The above is the detailed content of How to upgrade mysql with APT. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete