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

Detailed explanation of MySQL slow log query

Slow log query function The main function of slow...

Simple implementation method of Linux process monitoring and automatic restart

Purpose: Under Linux, the server program may be d...

Typescript+react to achieve simple drag and drop effects on mobile and PC

This article shares the specific code of typescri...

Detailed description of HTML table border control

Only show the top border <table frame=above>...

vue $set implements assignment of values ​​to array collection objects

Vue $set array collection object assignment In th...

Detailed explanation of node.js installation and HbuilderX configuration

npm installation tutorial: 1. Download the Node.j...

Using better-scroll component in Vue to realize horizontal scrolling function

About Recently, in the process of learning Vue, I...

Detailed tutorial on running multiple Springboot with Docker

Docker runs multiple Springboot First: Port mappi...

Detailed tutorial on installing Docker on CentOS 8.4

Table of contents Preface: System Requirements: I...

Detailed example of inserting custom HTML records in Quill editor

It is already 2020. Hungry humans are no longer s...

Analysis of the process of building a LAN server based on http.server

I don’t know if you have ever encountered such a ...

Detailed steps for installing rockerChat in docker and setting up a chat room

Comprehensive Documentation github address https:...

Solution to Docker disk space cleaning

Some time ago, I encountered the problem that the...

Examples of using the Li tag in HTML

I hope to align the title on the left and the dat...