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

Detailed explanation of MySQL foreign key constraints

Official documentation: https://dev.mysql.com/doc...

A brief analysis of the basic concepts of HTML web pages

What is a web page? The page displayed after the ...

How to modify iTunes backup path under Windows

0. Preparation: • Close iTunes • Kill the service...

Introduction to the use of CSS3 filter attribute

1. Introduction When writing animation effects fo...

Implementation of TypeScript in React project

Table of contents 1. Introduction 2. Usage Statel...

A question about border-radius value setting

Problem Record Today I was going to complete a sm...

Install Linux using VMware virtual machine (CentOS7 image)

1. VMware download and install Link: https://www....

How to periodically clean up images that are None through Jenkins

Preface In the process of continuous code deliver...

Web page layout should consider IE6 compatibility issues

The figure below shows the browser viewing rate i...

Introduction to Spark and comparison with Hadoop

Table of contents 1. Spark vs. Hadoop 1.1 Disadva...

CSS3 realizes the animation of shuttle starry sky

Result: html <canvas id="starfield"&...

How to import SQL files in Navicat Premium

I started working on my final project today, but ...