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

MySQL partitions existing tables in the data table

Table of contents How to operate Operation proces...

Detailed installation and use tutorial of mysql 8.0.15 under windows

This article shares with you the detailed install...

Solve the problem of spring boot + jar packaging deployment tomcat 404 error

1. Spring boot does not support jsp jar package, ...

How to configure multiple tomcats with Nginx load balancing under Linux

The methods of installing nginx and multiple tomc...

Summary of how JS operates on pages inside and outside Iframe

Table of contents Get the content of the iframe o...

Detailed explanation of mktemp, a basic Linux command

mktemp Create temporary files or directories in a...

CSS to achieve scrolling image bar example code

On some websites, you can often see some pictures...

Webpack file packaging error exception

Before webpack packaging, we must ensure that the...

CSS HACK for IE6/IE7/IE8/IE9/FF (summary)

Since I installed the official version of IE8.0, ...

Basic usage details of Vue componentization

Table of contents 1. What is componentization? 2....

Detailed installation process of MySQL 8.0 Windows zip package version

The installation process of MySQL 8.0 Windows zip...

Mybatis implements SQL query interception and modification details

Preface One of the functions of an interceptor is...

Detailed explanation of Mysql's method of optimizing order by statement

In this article, we will learn about the optimiza...

Two ways to configure Vue global methods

Table of contents 1. Introduction 2. The first me...

How to add website icon?

The first step is to prepare an icon making softwa...