How to remotely log in to the MySql database?

How to remotely log in to the MySql database?

Introduction: Sometimes, in order to develop a project, we need to deploy a MySql database server on a server, and then use a local computer to remotely access and manage the MySql database. So how do we implement remote login to MySql?

1. Use the command line to remotely log in to the MySql database

First, you need to create a user on the remote database (it is not recommended to use the root user) and grant the user the permission to log in remotely. You can refer to my other tutorial "MySql Complete Guide - Adding New Users, Creating Databases for Users, and Assigning Permissions to Users". The blog address is click to open the link.

It should be noted here that if the MySql server is deployed on Ubuntu, you need to modify the parameters in its configuration file my.cnf and use # in front to comment out "bind-adress=127.0.0.1", which means that the database server only allows local access. Note: The location of the configuration file is generally /etc/my.cnf or /etc/MySQL/my.cnf

# Instead of skip-networking the default is now to listen only on

# localhost which is more compatible and is not less secure.

#bind-address = 127.0.0.1 #Comment this line to log in remotely

2. Use the Workbench tool to log in remotely

(1) Click the plus sign to add a new connection


(2) Complete the operation according to the red font prompts

(3) Click "Store in Vault" in the above picture, enter the password, and then click "OK"


(4) Click "Test Connection" in step 2 to test the connection, and then click "OK" to complete the new connection. (If the test fails, don't worry, see the following common reasons for connection failure)

(5) You can see that the "AliyunService" in the figure below is a newly created connection. Click it to connect.


If the connection fails, there are many reasons. Make corrections one by one.

Common reasons for connection failure:

(1) Whether the username and password are correct;

(2) Does the user have remote connection permissions? If not, grant authorization is required. Please read my other tutorial and click to open the link.

(3) Is the port correct? Has it been changed to another port instead of the default 3306?

(4) If the server you are using is Alibaba Cloud ECS, have you configured the security group rules? Have you configured the security group rules? Have you configured the security group rules? Have you opened the connection port (the default is 3306)? If not, please read the following tutorial

A. Find the security group


B. Click "Configure Rules"


C. Add security group rules


D. Fill in the information


E. Restart the Alibaba Cloud server (generally, if you modify the ECS configuration in the Alibaba Cloud console, you need to restart it for the configuration information to take effect)


Well, that’s all for this blog. If you find this tutorial useful, I hope you will support it.

This concludes this article on how to implement remote login to the MySql database process analysis with MySql. For more related content on remote login to the MySql database with MySql, 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 remotely log in to the MySql database?
  • Tutorial on installing and configuring remote login to MySQL under Ubuntu
  • 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

<<:  Docker container monitoring and log management implementation process analysis

>>:  How to set npm to load packages from multiple package sources at the same time

Recommend

Mysql splits string into array through stored procedure

To split a string into an array, you need to use ...

Vue implements a simple shopping cart example

This article example shares the specific code of ...

js to achieve the complete steps of Chinese to Pinyin conversion

I used js to create a package for converting Chin...

Tutorial on compiling and installing MySQL 5.7.17 from source code on Mac

1. Download and unzip to: /Users/xiechunping/Soft...

Detailed application of Vue dynamic form

Overview There are many form requirements in the ...

Web page HTML code explanation: ordered list and unordered list

In this section, we will learn about list element...

Example explanation of alarm function in Linux

Introduction to Linux alarm function Above code: ...

Basic structure of HTML documents (basic knowledge of making web pages)

HTML operation principle: 1. Local operation: ope...

Solution to Navicat Premier remote connection to MySQL error 10038

Remote connection to MySQL fails, there may be th...

How to set mysql permissions using phpmyadmin

Table of contents Step 1: Log in as root user. St...

How to build a DHCP server in Linux

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

The difference and usage between div and span

Table of contents 1. Differences and characterist...

React implements import and export of Excel files

Table of contents Presentation Layer Business Lay...

HTML is something that web page creators must learn and master.

What are the benefits of learning HTML? 1: Easily...