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 mysql5.7 in Ubuntu 18.04 system

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

How to install mysql5.7 in Ubuntu 18.04 system? I believe that many inexperienced people are at a loss about this, so this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

The details are as follows

1.1 installation

First, execute the following three commands:

# install mysql service sudo apt-get install mysql-server# installation client sudo apt install mysql-client# installation depends on sudo apt install libmysqlclient-dev# check status sudo netstat-tap | grep mysql

1.2 set the root password

Ordinary users cannot enter mysql after mysql5.7 installation. The reason: the plugin of root has been changed to auth_socket. The plugin that logs in with password should be mysql_native_password. If you log in with root permission, you do not need password, change root password and login verification method:

$sudo su# mysqlmysql > mysql > select user, plugin from mysql.user +-+-- + | user | plugin | +-+-- + | root | auth_socket | | mysql.session | mysql_native_password | | mysql.sys | mysql_native_password | | debian-sys -maint | mysql_native_password | +-+-- + 4 rows in set (0.00 sec) mysql > update mysql.user set authentication_string=PASSWORD ('123456') Plugin='mysql_native_password' where user='root' Mysql > flush privileges;mysql > exitBye# exit$ sudo / etc/init.d/mysql restart$ mysql-uroot-pEnter password: Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 2Server version: 5.7.22-0ubuntu18.04.1 (Ubuntu) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.mysql >

1.3 configure mysql Telnet

# modify the configuration file, comment out bind-address = 127.0.0.1$ sudo vi / etc/mysql/mysql.conf.d/mysqld.cnf#, save and exit, then enter the mysql service and execute the authorization command: $mysql-uroot-pmysql > grant all on *. * to root@'%' identified by '123456' with grant option;Query OK, 0 rows affected, 1 warning (0.00 sec) mysql > flush privileges Query OK, 0 rows affected (0.00 sec) mysql > exitBye$ sudo / etc/init.d/mysql restart after reading the above, do you know how to install mysql5.7 in the Ubuntu 18.04 system? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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