Tutorial on installing and configuring remote login to MySQL under Ubuntu

Tutorial on installing and configuring remote login to MySQL under Ubuntu

This article shares the MySQL installation and configuration remote login tutorial for your reference. The specific content is as follows

1. Install MySQL

1. Install MySQL

1. sudo apt-get install mysql-server

2. sudo apt-get install mysql-client

3. sudo apt-get install libmysqlclient-dev

Note: During the installation process, you will be prompted to set a password and confirm the password. Remember the password.

After the installation is complete, you can use the following command to check whether the installation is successful:

root@root:/# ps aux|grep mysql
mysql 9323 1.4 10.3 1115748 138308 ? Ssl 22:34 0:00 /usr/sbin/mysqld
root 9486 0.0 0.0 21312 928 pts/18 S+ 22:34 0:00 grep --color=auto mysql

If you see the above results, the installation is successful.

You can log in to the MySQL database directly through the following command:

The password I set before was: root

root@root:/#mysql -uroot -proot

-u means to select the login user name.
-p indicates the login user password

這里寫圖片描述

2. Configure remote login

1. Open the configuration file

root@root:/# sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

2. Modify the configuration file

Change bind-address = 127.0.0.1 to 0.0.0.0 or comment it out

這里寫圖片描述

3. Add remote access permissions

root@root:/#mysql -uroot -proot
->GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' IDENTIFIED BY 'password' 
  WITH GRANT OPTION;
->FLUSH PRIVILEGES;

The above user and password can be set to your own

這里寫圖片描述

4. Check if it is successful

 root@root:/# netstat -an | grep 3306
 tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 

The above results indicate that the setup is successful

5. Restart MySQL

root@root:/# service mysql restart

6. Test the connection

Find the IP address via ifconfig

這里寫圖片描述

Test the connection on Navicat

這里寫圖片描述

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:
  • How to install the green version of MySQL Community Server 5.7.16 and implement remote login
  • How to modify the password of MySQL 5.1 and remotely log in to the MySQL database
  • Linux platform mysql enable remote login
  • mysql modify password and set to allow remote login
  • How to set up remote login to Mysql database
  • Solution to mysql remote login error
  • How to implement remote login in MySQL
  • About MYSQL remote login authorization method command

<<:  How to introduce scss into react project

>>:  Vue parent-child component mutual value transfer and call

Recommend

Vue+echart realizes double column chart

This article shares the specific code of vue+echa...

Practice of multi-layer nested display of element table

There is a requirement for a list containing mult...

How to build a DHCP server in Linux

Table of contents 1. Basic knowledge: 2. DHCP ser...

Introduction to the process of creating TCP connection in Linux system

Table of contents Steps to create TCP in Linux Se...

Detailed installation process of MySQL5.6.40 under CentOS7 64

MySQL5.6.40 installation process under CentOS7 64...

Detailed explanation of the usage of grep command in Linux

1. Official Introduction grep is a commonly used ...

Use of MySQL query rewrite plugin

Query Rewrite Plugin As of MySQL 5.7.6, MySQL Ser...

How to use Docker Compose to implement nginx load balancing

Implement Nginx load balancing based on Docker ne...

Detailed explanation of the transition attribute of simple CSS animation

1. Understanding of transition attributes 1. The ...

Detailed steps for running springboot project in Linux Docker

Introduction: The configuration of Docker running...

Understanding and solutions of 1px line in mobile development

Reasons why the 1px line becomes thicker When wor...

HTML weight loss Streamline HTML tags to create web pages

HTML 4 HTML (not XHTML), MIME type is text/html, ...