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

How to uninstall MySQL 5.7.19 under Linux

1. Find out whether MySQL was installed before Co...

GZIP compression Tomcat and improve web performance process diagram

1. Introduction I recently worked on a project an...

js to achieve simple calendar effect

This article shares the specific code of js to ac...

How to retrieve password for mysql 8.0.22 on Mac

Mac latest version of MySQL 8.0.22 password recov...

MySQL log system detailed information sharing

Anyone who has worked on a large system knows tha...

Detailed explanation of Vuex environment

Table of contents Build Vuex environment Summariz...

Vue3.0 routing automatic import method example

1. Prerequisites We use the require.context metho...

Detailed explanation of Grid layout and Flex layout of display in CSS3

Gird layout has some similarities with Flex layou...

Express implements login verification

This article example shares the specific code for...

React implements double slider cross sliding

This article shares the specific code for React t...

CSS3 achieves various border effects

Translucent border Result: Implementation code: &...

How to implement HTML Table blank cell completion

When I first taught myself web development, there...

Mac node deletion and reinstallation case study

Mac node delete and reinstall delete node -v sudo...