Home > Database > Mysql Tutorial > body text

Detailed introduction to enabling remote login with mysql on Linux platform

黄舟
Release: 2017-03-29 13:31:42
Original
1183 people have browsed it

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;
Copy after login

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;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template