通过xshell终端能连接到数据:
但是我在线上通过正式域名下的一个php(www.discountfollow.com/a.php)测试文件去连接数据库,提示:
the database is error:Access denied for user 'root'@'www.discountfollow.com' (using password: YES)
请问这是什么原因导致这种问题的呀!谢谢。。。
通过xshell终端能连接到数据:
但是我在线上通过正式域名下的一个php(www.discountfollow.com/a.php)测试文件去连接数据库,提示:
the database is error:Access denied for user 'root'@'www.discountfollow.com' (using password: YES)
请问这是什么原因导致这种问题的呀!谢谢。。。
我曾经遇见坑是,数据库用户只有监听在127.0.0.1
上面才行,监听在localhost
上面不行
新建数据库,
CREATE DATABASE testdb;
你新建数据库普通用户,
CREATE USER 'dba'@'127.0.0.1' IDENTIFIED BY '123456';
授权,
Grant select, insert, update, delete on testdb.* to dba@'127.0.0.1' ;
然后用dba
用户连接testdb
数据库在127.0.0.1
上面
如果连接不了,那么报错是什么呢?根据错误信息调试,比如地址错误,密码错误。端口错误等等
Copyright 2014-2023 //m.sbmmt.com/ All Rights Reserved | 苏州跃动光标网络科技有限公司 | 苏ICP备2020058653号-1
| 本站CDN由 数掘科技 提供