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 install MySQL 8.0.11 on Ubuntu Linux

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

Share

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

After MySQL 5.7, I jumped directly to MySQL 8.0. officials said there was a big upgrade this time, and the access speed was twice as fast as 5.7without saying anything else, so I also tried to install and use it. According to the official documentation, the following is the installation process.

I. tools

Ubuntu 16.04

MySQL Community Server 8.0.11

Second, installation process 1. Download the installation package

Choose the general two-level version of Linux 64-bit, so that it does not need to be compiled and installed, and the system can be used directly after the installation depends on the library.

two。 Install dependent libraries

Officials say they want to install libaio, but in fact, if you can't install the libaio library, you also need to install the numactl library, as follows

Apt install numactlapt install libaio-dev3. Extract the package to the system

After unpacking, move the package to the / usr/local directory on the system and name it mysql

Tar-zxvf mysql-8.0.11-linux-glibc2.12-x86_64.tar.gzmv mysql-8.0.11-linux-glibc2.12-x86_64 / usr/local/mysql4. Add users and set permissions groupadd mysqluseradd-r-g mysql- s / bin/false mysqlcd / usr/localcd mysqlmkdir mysql-fileschown mysql:mysql mysql-fileschmod 750mysql-files5. Initialize the database bin/mysqld-initialize-user=mysql

You can see that the system randomly assigns a password to root users, as shown in the figure. This password should be remembered and can be changed after customization.

6. Install the SSL service

Install openssl before executing the installation command, otherwise an error will be reported

Apt install opensslbin/mysql_ssl_rsa_setup7. Copy the service file cp support-files/mysql.server / etc/init.d/mysql.server 3. Use MySQL 8.0.111. Start the service

& means to run in the background. After executing the command, the terminal will be stuck in a location, and then click Enter, as shown in the figure.

Bin/mysqld_safe-- user=mysql & 2. Log in using the user root

You can count it into the database by using the password you just randomly generated

Bin/mysql-uroot-p3. Change root user password

Using random login for the first time does not work, so we need to change the password as follows

(1)。 Option 1: restrict local login

ALTER USER 'root'@'localhost' IDENTIFIED BY' New password; flush privileges

(2)。 Option 2: you can log in with any IP and third-party clients.

ALTER USER 'root'@'localhost' IDENTIFIED BY' password 'PASSWORD EXPIRE NEVER; # modify the password and encryption method of root use mysql; # switch to mysql library update user set host='%' where user =' root'; # change the IP that can be logged in to any IPALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY' password; # change the root user password again so that it can access flush privileges; # refresh permissions at any IP

After you have changed it, log out and log back in with the new password, look at the database again, and you can see that you can use the

This is the end of MySQL 8.0.11 installation. Thank you for your reading. If you have any questions, please feel free to leave a comment.

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