Home  >  Article  >  Database  >  Detailed introduction to enabling remote login with mysql on Linux platform

Detailed introduction to enabling remote login with mysql on Linux platform

黄舟
黄舟Original
2017-03-29 13:31:421140browse

This article shares with you the method of opening the remote login connection for MySQL on the Linux platform. Friends who have the same needs can refer to the following

I often encounter the problem of remote access to mysql during the development process. I need to search every time. It feels too troublesome. I will record it here so that I can refer to it later.

First access the mysql of this machine (use ssh to log in to the terminal and enter the following command):

mysql -uroot -p

Enter After logging in with the password, enter the following statement:

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

Among them:

user is the user name

mysql default is root

password is the password itself Set

% to represent any host, or you can specify the IP address

to allow access from any remote host.

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.

The above is the detailed content of Detailed introduction to enabling remote login with mysql on Linux platform. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn