Home > Database > Mysql Tutorial > mysql prohibit external access solution

mysql prohibit external access solution

little bottle
Release: 2019-04-19 14:10:01
forward
4079 people have browsed it

This article mainly talks about the solution when MySQL prohibits external access. It has a certain collection value. Friends in need can learn about it.

1. When the port is open, ubuntu mysql 3306 allows remote access
vim /etc/mysql/mysql.conf.d/mysqld.cnf
Comments#bind- address                 = 127.0.0.1

2. Authorize the user to allow remote access:
grant all privileges on *.* to root@"%" identified by "pwd" with grant option;
flush privileges ;

Create and authorize users to test certain permissions, operations in the user table of mysql database

1.mysql creates users:
CREATE USER 'taoshihan'@'localhost ' IDENTIFIED BY '';
localhost is just local
% is allowed to be remote
CREATE USER 'taoshihan115'@'%' IDENTIFIED BY 'TAOshihan1';

Delete user:
drop user 'taoshihan'@'localhost'

2.Authorization:
GRANT select ON *.* TO 'taoshihan115'@'%';Authorization specification
GRANT all ON *.* TO ' taoshihan115'@'%';Authorize all

When mysql cannot be restarted, check whether the log directory such as /var/log/mysql exists, and whether the group and owner are mysql

If not, create the directory and change the owner of the directory chown mysql:mysql

If you want to know more mysql tutorials, please pay attention to the PHP Chinese website to learn more mysql tutorials!

The above is the detailed content of mysql prohibit external access solution. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template