Linux platform mysql enable remote login

Linux platform mysql enable remote login

During the development process, I often encounter problems with remote access to MySQL. I need to search every time, which feels too troublesome. I record it here so that I can check it later.

First, access the local mysql (log in to the terminal using ssh and enter the following command):

mysql -uroot -p

After entering the password to log in, enter the following statement:

use mysql;
grant all privileges on *.* to 'user'@'%' identified by 'password' with grant option;

in:

user is the user name

The default for mysql is root

Password is the password you set yourself

% represents any host, you can also specify an IP address

This allows any remote host to access it.

Example:

grant all privileges on *.* to 'root'@'192.168.1.100' identified by '' with grant option;

That is, allow 192.168.1.100 to log in as the root user without a password.

Okay, that’s all, hope it helps you.

You may also be interested in:
  • How to disable root remote login and add new users in Linux
  • Configuring remote password-free login under Linux
  • Teach you how to modify the Linux remote login welcome prompt information
  • Novice learn Linux commands: ssh command (remote login)
  • Use expect script to realize automatic login of remote machine in Linux
  • Remote login to Windows XP desktop under Linux rdesktop operating system
  • Linux remote login implementation tutorial analysis

<<:  Solution to the problem that docker nginx cannot be accessed after running

>>:  Implementing the page turning effect through sliding and the click event problem on the mobile terminal

Recommend

Detailed explanation of the integer data type tinyint in MySQL

Table of contents 1.1Tinyint Type Description 1.2...

Tutorial on installing lamp-php7.0 in Centos7.4 environment

This article describes how to install lamp-php7.0...

Example of how to deploy a Django project using Docker

It is also very simple to deploy Django projects ...

How to Communicate with Other Users on the Linux Command Line

It's easy to send messages to other users in ...

Detailed explanation of Mysql's concurrent parameter adjustment

Table of contents Query cache optimization Overvi...

W3C Tutorial (16): Other W3C Activities

This section provides an overview of some other i...

How to add fields to a large data table in MySQL

Preface I believe everyone is familiar with addin...

Detailed explanation of JavaScript prototype and examples

Table of contents The relationship between the co...

A brief analysis of kubernetes controllers and labels

Table of contents 01 Common controllers in k8s RC...

Detailed analysis of the syntax of Mysql update to modify multiple fields and

When updating a record in MySQL, the syntax is co...

How to View All Running Processes in Linux

You can use the ps command. It can display releva...

Detailed explanation of the solution to Ubuntu dual system stuck when starting

Solution to Ubuntu dual system stuck when startin...