Get the App
SLTechnology News&Howtos  ›  Database  › 

How to install mysql5.7.23 in Ubuntu18.04

Shulou Source: shulou.com Published: 2022-05-31 23:21:30 10月18日 Update

This article shows you how to install mysql 5.7.23 in Ubuntu 18.04. It is concise and easy to understand. It will definitely make your eyes shine. I hope you can learn something from the detailed introduction of this article.

1. Install server and client

#install mysql service sudo apt-get install mysql-server#install client sudo apt install mysql-client#install dependency sudo apt install libmysqlclient-dev

2. Check installation status

#check status sudo netstat -tap| grep mysql

The following figure indicates successful installation

3. Configuration after installation

After mysql 5.7 is installed, ordinary users cannot enter mysql. Reason: root plugin is modified to auth_socket. Plugin logged in with password should be mysql_native_password. Log in directly with root permission without password. Modify root password and login authentication 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 -p Enter 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>

4. Configure mysql remote login

#Modify the configuration file, comment out bind-address = 127.0.0.1 $ sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf #Save exit, then enter mysql service, execute authorization command: $ mysql -uroot -p mysql> 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 The above is how to install mysql 5.7.23 in Ubuntu 18.04. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserves, please pay attention to the industry information channel.

Tags: Password service login configuration Zhongan content customer client skill status knowledge check normal concise successful concise below figure no reason command Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Redmi Shulou Information MySQL Microsoft