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

Ubuntu 18.04 install mysql 5.7.23

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

Share

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

It was very smooth to install MySQL in Ubuntu 16.04. this time when installing MySQL 5.7.23 in Ubuntu 18.04, we encountered some pits and struggled for a long time. Here is a record.

1. Install the database

Sudo apt-get install mysql-server

By default, related clients such as mysql-client will be installed when mysql-server is installed.

two。 There will be problems when logging in directly at this time.

This is a pit, and later found that the use of root permissions to log in will be successful.

Well, since you can only log in under the authority of the root user, let's take a look at what key information exists in mysql.user.

First look at the structure of the user table:

Mysql > show columns from user

There are mainly these items:

Host User authentication_string (this is the encrypted password) plugin

Take a look at these key pieces of data in the table:

As you can see, the root password is still empty, and plugin is obviously different from others. After consulting the relevant information, we found that this is the problem that ordinary users can not log in.

3. Resolve the problem and change the password

Mysql > update user set authentication_string=PASSWORD ("123456"), plugin= "mysql_native_password" where user= "root"; mysql > FLUSH PRIVILEGES; # exit restart MySQL service mysql > exit;fknight@v310:~$ service mysql restart

After update:

You can now log in to the MySQL database using the root account name with normal user privileges. Workbench/Navciat can also connect to the database for normal use.

Summary:

# install MySQL and Workbranchfknight@v310:~$ sudo apt-get install mysql-server mysql-client mysql-workbench # connect data with root authority, initial password is empty fknight@v310:~$ sudo mysql- u root-p # modify plugin to enable ordinary users to log in using mysql's root user, and change root password mysql > update user set authentication_string=PASSWORD ("123456"), plugin= "mysql_native_password" where user= "root"; # exit and restart MySQL service mysql > exit Fknight@v310:~$ service mysql restart

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

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