How to access MySql through IP address

How to access MySql through IP address

1. Log in to mysql:

 mysql -u root -h 127.0.0.1 -p

2. Switch database

 use mysql

3. Authorization

grant all privileges on *.* to 'root'@'127.0.0.1'identified by 'password';

Replace 127.0.0.1 with the public network IP address.

4. Check my.ini

4.1 Check if there is skip-networking

After skip-networking is enabled, MySQL cannot be accessed remotely.

For security reasons, if you want to access MySQL from a specific IP address, you can add bind-address=IP to the configuration file, provided that skip-networking is disabled.

Add under port=3306

bind-address=192.168.1.100 or bind-address=0.0.0.0

Other questions: Try mysql -u root -p -h 192.168.1.100 on the server to see if you can log in successfully. If you can log in, but cannot log in through the client machine, it means there is a problem with the firewall or security dog, so just turn it off.

Summarize

The above is the method of accessing MySql through the IP address introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • How to store IP addresses in MySQL
  • MySQL cross-database table replication example (in the same IP address)
  • Example method to view the IP address connected to MySQL

<<:  How to understand the difference between computed and watch in Vue

>>:  How to view and terminate running background programs in Linux

Recommend

Simple comparison of meta tags in html

The meta tag is used to define file information an...

Example of how to quickly build a LEMP environment with Docker

LEMP (Linux + Nginx + MySQL + PHP) is basically a...

Detailed explanation of the use of Vue's new built-in components

Table of contents 1. Teleport 1.1 Introduction to...

Using CSS3's 3D effects to create a cube

Learning to use CSS3's 3D effects to create a...

Solve the problem of garbled Chinese characters in Mysql5.7

When using MySQL 5.7, you will find that garbled ...

Docker container orchestration implementation process analysis

In actual development or production environments,...

Summary of two methods to implement vue printing function

Method 1: Install the plugin via npm 1. Install n...

Solution to the problem that the InnoDB engine is disabled when MySQL is started

Find the problem Today at work, when copying tabl...

Solution to changing the data storage location of the database in MySQL 5.7

As the data stored in the MySQL database graduall...

MySQL index usage instructions (single-column index and multi-column index)

1. Single column index Choosing which columns to ...

In-depth explanation of InnoDB locks in MySQL technology

Table of contents Preface 1. What is a lock? 2. L...

More Ways to Use Angle Brackets in Bash

Preface In this article, we will continue to expl...

Nginx reverse proxy configuration removes prefix

When using nginx as a reverse proxy, you can simp...

How to create a simple column chart using Flex layout in css

The following is a bar chart using Flex layout: H...

Specific method to add foreign key constraints in mysql

The operating environment of this tutorial: Windo...