1、没有在数据库建立远程登陆账号
GRANT
ALL
PRIVILEGES
ON
*
.
*
TO
'
name
'
@
'
%
'
IDENTIFIED
BY
'
pwd
'
WITH
GRANT
OPTION
;
2、配置my.cnf
如果在mysql配置文件中有skip-networking就不能远程登陆即使建立了远程账号
#
Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
给指定数据表建立用户远程访问,并指定权限
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON TableName.* TO 'uname'@'%' IDENTIFIED BY 'pwd';
flush privileges;
本文介绍如何在MySQL中配置远程访问,包括创建远程登录账号、调整my.cnf配置文件以启用网络连接,以及为特定表授予用户远程访问权限的方法。
189

被折叠的 条评论
为什么被折叠?



