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

What are the methods and steps for MySQL8.0 upgrade

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

The main content of this article is to explain "what are the methods and steps of MySQL8.0 upgrade". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the methods and steps of MySQL8.0 upgrade"?

1. First completely uninstall the existing version of MySQL.

You can use the following command:

# Delete mysql data file sudo rm-R / var/lib/mysql/# Delete mysql configuration file sudo rm-R / etc/mysql/# automatically uninstall mysql (including server and client) sudo apt-get autoremove mysql*-- purgesudo apt-get remove apparmor

Be sure to delete the configuration file because it may be incompatible.

two。 Download deb and press MySQL8.x.

You can download it from the official website at https://dev.mysql.com/repo/apt

We choose the latest deb download at:

Https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb . Use the wget command to download after the command, as follows:

Wget https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb

After the download is complete, use the dpkg command and update the apt source, and then you can install it. The complete command is as follows:

Dpkg-I mysql-apt-config_0.8.20-1_all.debapt-get updateapt-get install-y mysql-server

During the last command execution, it will let you enter your root password and some basic configuration, and then you can complete the installation.

Because MySQL is installed in ubuntu, the startup method is:

Service mysql start

You can use the command to check the operation of the process, which is similar to the output if you need to:

/ usr/sbin/mysqld-basedir=/usr-datadir=/var/lib/mysql-plugin-dir=/usr/lib/mysql/plugin-log-error=/var/log/mysql/error.log-pid-file=/var/run/mysqld/mysqld.pid-socket=/var/run/mysqld/mysqld.sock

3. Create users and configure permissions.

During the actual use of MySQL8.0.x, it is found that the user authorization is a little different from the previous version, which needs to be divided into three steps:

Create a user.

Assign permissions.

Refresh permissions.

The specific sql statements are as follows, and the order is strict:

Create user 'freephp'@'%' identified by' 176serTTc8Cgholders * grant all privileges on dev_database.* to 'freephp'@'%' with grant option;flush privileges

As explained by sql above, the first sentence is to create a user named freephp, with a password of 176serTc8CgMagne% which means that any host can connect.

The second sentence means to grant all permissions of dev_database to the user freephp.

The third sentence is to refresh the permissions immediately so that the newly created permissions take effect.

At this point, I believe you have a deeper understanding of "what are the methods and steps of MySQL8.0 upgrade". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Development

Wechat

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

12
Report