Detailed explanation of how to access MySQL database remotely through Workbench

Detailed explanation of how to access MySQL database remotely through Workbench

Preface

Workbench is installed on one computer, and now you need to access the MySQL database on another Ubuntu server. However, access to MySQL is not allowed by default. Considering security issues, it is not suitable to use the root user to access MySQL.

At this time we need to open the MySQL server and create a new user to access MySQL.

1. Open MySQL

The mysql configuration file is in the /etc/mysql/my.cnf file. There is a line in it that says bind-address = 127.0.0.1 , which means that only local access is allowed. Just comment this line.

2. Create a new mysql user

(1) First, enter the MySQL database locally.

(2) Create a user: GRANT ALL ON *.* to user@'IP' IDENTIFIED BY 'password'; user indicates the name of the user to be created; IP indicates which client wants to access the MySQL database; password indicates the password; and grant all permissions.

(3) FLUSH PRIVILEGES; refresh the MySQL system permission related tables, otherwise access will be denied. Restarting the database can also achieve this effect

3. Restart the database

Use the command sudo service mysql restart to restart the database

4. Use workbench to connect to the database

The host name indicates the database IP address that needs to be connected


The effect of successful connection

Click to enter the page

Note: You cannot access mysql in the Docker container environment in the Ubuntu server

Summarize

The above is the full content of this article. I hope that the content of this article can bring some help to your study or work. If you have any questions, you can leave a message to communicate. Thank you for your support of 123WORDPRESS.COM.

You may also be interested in:
  • Detailed explanation of the workbench example in mysql
  • mysql workbench installation and configuration tutorial under centOS
  • MySQL and MySQL Workbench Installation Tutorial under Ubuntu
  • Solution to the error "libpng12-0 package not installed" when installing mysql workbench in Ubuntu 16.10
  • How to use MySQL Workbench (picture and text)
  • How to solve the MySQL Workbench gnome-keyring-daemon error
  • MYSQL ZIP installation-free version configuration steps and graphical management tool mysql-workbench
  • MySQL WorkBench Management Operations MySQL Tutorial
  • How to export MySQL database relationship diagram using workbench
  • Mysql Workbench query mysql database method

<<:  Example of implementing dynamic verification code on a page using JavaScript

>>:  Linux kernel device driver memory management notes

Recommend

Calling the search engine in the page takes Baidu as an example

Today, it suddenly occurred to me that it would be...

Color matching techniques and effect display for beauty and styling websites

Color is one of the most important elements for a...

How to introduce scss into react project

First download the dependencies yarn add sass-loa...

How to use Volume to transfer files between host and Docker container

I have previously written an article about file t...

How to insert batch data into MySQL database under Node.js

In the project (nodejs), multiple data need to be...

Web interview Vue custom components and calling methods

Import: Due to project requirements, we will enca...

A complete list of meta tag settings for mobile devices

Preface When I was studying the front end before,...

What we can learn from Google's new UI (pictures and text)

The most significant website change in 2011 was Go...

Win2008 Server Security Check Steps Guide (Daily Maintenance Instructions)

The document has been written for a while, but I ...

How to limit the number of records in a table in MySQL

Table of contents 1. Trigger Solution 2. Partitio...

JS implements a stopwatch timer

This article example shares the specific code of ...

Detailed explanation of the use of MySQL select cache mechanism

MySQL Query Cache is on by default. To some exten...