Detailed explanation of the process of installing MySQL on Ubuntu 18.04.4

Detailed explanation of the process of installing MySQL on Ubuntu 18.04.4

Let's take a look at the process of installing MySQL on Ubuntu 18.04.4. The content is as follows:

1 sudo apt-get update
2 sudo apt-get install mysql-server
3 sudo mysql_secure_installation # Initial configuration #1
VALIDATE PASSWORD PLUGIN can be used to test passwords...
Press y|Y for Yes, any other key for No: N (My Options)
#2
Please set the password for root here...
New password: (Enter password)
Re-enter new password: (re-enter)
#3
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them...
Remove anonymous users? (Press y|Y for Yes, any other key for No) : N (My option)
#4
Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network...
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y (my choice)
#5
By default, MySQL comes with a database named 'test' that
Anyone can access...
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : N (My option)
#6
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y (my choice)
4 systemctl status mysql.service # Check server status
4 systemctl status mysql.service # Check server status

Running means no problem

5 Modify the mysql port number and change the listening address to all vim /etc/mysql/mysql.conf.d/mysqld.cnf # Edit the configuration file bind-address = 0.0.0.0 # Change the listening ip to all port = 3388 # Change the listening port to 3388, you can leave it unchanged for safety. After the modification, restart the service systemctl restart mysql.service
6 Open mysql remote access 1 Log in to the database mysql -u root -p

2 Switch to database mysql
use mysql
3 Delete anonymous users delete from user where user='';
4 Add users who are allowed remote access or allow remote access for existing users. Grant root all permissions to access any database on any host (%). mysql> grant all privileges on *.* to 'root'@'%' identified by 'Replace here with the password you want to set' with grant option;
flush privileges;
5 Exit the database mysql> exit
6 Restart the database sudo service mysql restart

This is the end of this article about the detailed process of installing MySQL on Ubuntu 18.04.4. For more information about installing MySQL on Ubuntu 18.04.4, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to install JDK and Mysql on Ubuntu 18.04 Linux system
  • Complete tutorial on installing Apache, MySQL, PHP, LAMP on Ubuntu 18.04
  • Ubuntu 18.04 does not prompt for password when installing MySQL and how to solve it

<<:  HTML n ways to achieve alternate color code sample code

>>:  A few things about favicon.ico (it’s best to put it in the root directory)

Recommend

Detailed explanation of the principle of Docker image layering

Base image The base image has two meanings: Does ...

Solution to Ubuntu cannot connect to the network

Effective solution for Ubuntu in virtual machine ...

Summary of DTD usage in HTML

DTD is a set of grammatical rules for markup. It i...

Several ways to use v-bind binding with Class and Style in Vue

Adding/removing classes to elements is a very com...

How to set the number of mysql connections (Too many connections)

During the use of mysql, it was found that the nu...

JavaScript form validation example

HTML forms are commonly used to collect user info...

HTML meta usage examples

Example Usage Copy code The code is as follows: &l...

How to use nginx to build a static resource server

Taking Windows as an example, Linux is actually t...

HTML hyperlink a tag_Powernode Java Academy

Anyone who has studied or used HTML should be fam...

Sample code for implementing Alipay sandbox payment with Vue+SpringBoot

First, download a series of things from the Alipa...

Nodejs global variables and global objects knowledge points and usage details

1. Global Object All modules can be called 1) glo...

Explanation of Truncate Table usage

TRUNCATE TABLE Deletes all rows in a table withou...

JavaScript to achieve mouse tailing effect

Mouse effects require the use of setTimeout to ge...

Javascript front-end optimization code

Table of contents Optimization of if judgment 1. ...

VMware WorkStation 14 pro installation Ubuntu 17.04 tutorial

This article records the specific method of insta...