Tutorial on installing mysql5.7.23 on Ubuntu 18.04

Tutorial on installing mysql5.7.23 on Ubuntu 18.04

This article shares with you the specific method of installing mysql5.7.23 on Ubuntu18.04 for your reference. The specific content is as follows

Reference article: Install MySQL 5.7 on Ubuntu 18.04

1. Install the server and client

# Install mysql service sudo apt-get install mysql-server
# Install the client sudo apt install mysql-client
# Install dependencies sudo apt install libmysqlclient-dev

2. Check the installation status

# Check the status sudo netstat -tap | grep mysql

The following figure appears to indicate that the installation is successful

3. Configuration after installation

After mysql5.7 is installed, ordinary users cannot enter mysql. The reason is: the root plugin has been changed to auth_socket. The plugin for logging in with a password should be mysql_native_password. Log in directly with root privileges without a password. Change the root password and login verification method

$ sudo su
#mysql
mysql>
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> exit
Bye
# 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 2
Server 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 its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
mysql> 

4. Configure MySQL remote login

# Modify the configuration file and 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 -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> exit
Bye
$ sudo /etc/init.d/mysql restart

Wonderful topic sharing:

MySQL different versions installation tutorial

MySQL 5.7 installation tutorials for various versions

MySQL 5.6 installation tutorials for various versions

mysql8.0 installation tutorials for various versions

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Install MySQL in Ubuntu 18.04 (Graphical Tutorial)
  • Install MySQL 5.7 on Ubuntu 18.04
  • Ubuntu18.04 installation mysql8.0.11 graphic tutorial
  • How to install MySQL on Ubuntu 18.04 (linux)
  • Ubuntu 18.0.4 installs mysql and solves ERROR 1698 (28000): Access denied for user ''''root''''@''''localhost'''

<<:  Detailed explanation of the usage and difference between nohup and & in Linux

>>:  Detailed explanation of the JVM series memory model

Recommend

CentOS 7.x deployment of master and slave DNS servers

1. Preparation Example: Two machines: 192.168.219...

Set IE8 to use IE7 style code

<meta http-equiv="x-ua-compatible" co...

A brief analysis of different ways to configure static IP addresses in RHEL8

While working on a Linux server, assigning static...

Write a publish-subscribe model with JS

Table of contents 1. Scene introduction 2 Code Op...

Analysis of the use of Linux vulnerability scanning tool lynis

Preface: Lynis is a security audit and hardening ...

Nginx configuration location matching rules example explanation

The scope of nginx configuration instructions can...

View the number of files in each subfolder of a specified folder in Linux

count script #!/bin/sh numOfArgs=$# if [ $numOfAr...

Two ways to start Linux boot service

Table of contents rc.local method chkconfig metho...

Analysis of Linux configuration to achieve key-free login process

1.ssh command In Linux, you can log in to another...

Implementation of MySQL master-slave status check

1. Check the synchronization status of A and B da...

Implementation of MySQL's MVCC multi-version concurrency control

1 What is MVCC The full name of MVCC is: Multiver...

WeChat applet implements calculator function

WeChat Mini Programs are becoming more and more p...

Nginx reverse proxy forwards port 80 requests to 8080

Let's first understand a wave of concepts, wh...