Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use APT Library to install MySQL

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

In this issue, the editor will bring you about how to use the APT library to install MySQL. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.

Add APT Warehouse

Visit https://dev.mysql.com/downloads/repo/apt/.

Choose to download the deb package that suits your platform.

Execute the following command to install the downloaded package.

Sudo dpkg-I / PATH/version-specific-package-name.deb

Replace version-specific-package-name.deb with the name of the downloaded package.

During installation, you need to select the version of mysql server and components. If you can't determine the version, don't change the default version. If you don't want to install a component, choose none. After the selection, select ok to complete the installation.

After the installation is complete, you can also modify the mysql version by selecting the distribution version.

You can update the package with the following command.

Apt-get update

In addition to leveraging the released deb package, you can also manually add your own APT repository. See https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/index.html#repo-qg-apt-repo-manual-setup for details

Note: once the MYSQL APT repository is in effect, you cannot install any packages of MYSQL from the software libraries that come with the system.

APT install MYSQL

Install mysql using the following command:

Apt-get install mysql-server

The command to install the mysql client and database normal files is similar to the command above.

During installation, you need to provide a password for the root user (you need to remember it).

Tip: if you want to set the password later, you can choose ok without providing the password and continue with the installation. In this case, root can connect to mysql through Unix socket file and be authorized by Socket Peer-Credential Pluggable Authentication. You can set the password for root later through mysql_secure_installation.

Start and stop mysql server

After Mysql server is installed, it starts automatically. You can check the status of Mysql server with the following command:

Service mysql status

Stop Mysql server from running using the following command:

Service mysql stop

Start Mysql server using the following command

Service mysql start

Restart Mysql server using the following command

Service mysql restart

Note: some third-party native repository packages that rely on native MySQL packages may not work with MySQL APT repository packages. For example: konadi-backend-mysql, handlersocket-mysql-5.5, and zoneminder.

Select a release version

The default version for installation and upgrade of Mysql server and all components is from the version selected to add the APT repository. You can use the following command to modify the original selection at any time.

Dpkg-reconfigure mysql-apt-config

After the modification, update the mysql repository with the following command:

Apt-get update

Run the apt-get install command again and the version of your choice will be installed.

The component version selection for Mysql is similar.

Install additional MYSQL products and components

After adding Mysql's APT repository. First, get the latest package information from the APT repository with the following command.

Apt-get update

Install the component or add-on of your choice with the following command, and replace package-name with the package name.

Apt-get install package-name

For example: install shared client libraries:

Apt-get install libmysqlclient18APT Delete mysql

To remove mysql server and its components installed with the MySQL APT repository, first remove mysql server with the following command:

Apt-get remove mysql-server

Then remove the software that is automatically installed with mysql server:

Apt-get autoremove

Delete subsidiary products and components with the following command, and replace package-name with the package name you want to delete:

Apt-get remove package-name

To view the packages you installed with MySQL APT repository, use the following command:

Dpkg-l | grep mysql | grep ii the above is shared by the editor on how to install MySQL using the APT library. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report