简体   繁体   English

codeigniter无法在用户上访问MySQL,但是使用root登录就可以了

[英]codeigniter failed to access MySQL on user, but logs in just fine with root

I actually fixed my problem, I just wanted to post my solution. 我实际上解决了问题,我只想发布我的解决方案。

If someone wants to offer further thoughts for those after us that find this post, that's fine too. 如果有人想为找到我们这篇文章的我们之后的人们提供进一步的想法,那也很好。


All of my codeigniter files were copied over. 我所有的codeigniter文件都被复制了。 So I knew my php code should have been fine. 所以我知道我的PHP代码应该没问题。 My DB was exported as a .SQL file, so I didn't think that could be the problem either. 我的数据库被导出为.SQL文件,因此我也不认为这可能是问题。

And I deleted / recreated the user several times, trying to figure out what I did wrong. 然后我多次删除/重新创建了用户,试图找出我做错了什么。

  • Username: smellysocks 用户名:smorysocks
  • Password: smelliersocks 密码:sodoriersocks
  • Host: % 主持人:%
  • Type: database-specific 类型:特定于数据库
  • ALL PRIVILEGES (minis GRANT, all database-specific of course) 所有特权(当然是GRANT,当然所有数据库都是如此)

Eventually I changed the host type to "localhost", as that was the only difference I could find. 最终,我将主机类型更改为“ localhost”,因为这是我可以找到的唯一区别。 In my mind this should not have fixed the problem, but the code runs fine now with no problems. 在我看来,这不应该解决问题,但是代码现在可以正常运行了,没有任何问题。

Phrases I searched on Google for: 我在Google上搜索的短语:

  • "mysql only root works" “ MySQL仅根目录有效”
  • "Codeigniter Filename: core/Loader.php Line Number: 305" “ Codeigniter文件名:core / Loader.php行号:305”
  • "Codeigniter Unable to connect to your database server using the provided settings" “ Codeigniter无法使用提供的设置连接到数据库服务器”
  • "Codeigniter mysqli::real_connect(): (HY000/1045): Access denied for user" “ Codeigniter mysqli :: real_connect():(HY000 / 1045):用户被拒绝访问”
  • "Codeigniter A PHP Error was encountered Severity: Warning Message: mysqli::real_connect(): (HY000/1045): Access denied for user" “ Codeigniter遇到PHP错误,严重性:警告消息:mysqli :: real_connect():(HY000 / 1045):用户的访问被拒绝”

A host value of % does not include localhost for sockets and thus must be specified if you want to connect using any method. 主机值%不包含用于套接字的localhost,因此,如果要使用任何方法进行连接,则必须指定该值。 further link link link 进一步链接 链接 链接

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法连接到 MySQL:用户 'u201944136_root'@'localhost' 的访问被拒绝(使用密码:是) - Failed to connect to MySQL: Access denied for user 'u201944136_root'@'localhost' (using password: YES) 无法连接到 MySQL:用户 'root'@'localhost' 的访问被拒绝(使用密码:是) - Failed to connect to MySQL: Access denied for user 'root'@'localhost' (using password: YES) mysql_connect():用户“ root”的访问被拒绝 - mysql_connect(): Access denied for user 'root' Mysql允许root用户访问,但是以root用户身份具有所有特权的用户无法访问acces - Mysql allows access for root user, but acces is denied for user with all privileges as root user 以root用户身份运行codeigniter脚本 - Run codeigniter script as root user mysql_connect():用户'root'@'localhost'的访问被拒绝 - mysql_connect(): Access denied for user 'root'@'localhost' MYSQL错误:拒绝用户'root'@'localhost'的访问(1045) - MYSQL error: Access denied for user 'root'@'localhost' (1045) 使用php插入mysql:以root用户身份拒绝访问 - using php to insert into mysql: access denied as root user 执行代码时,对用户“ root” @“ localhost”的MySQL访问被拒绝(Windows 7) - MySQL Access denied for user 'root'@'localhost' when executing code (Windows 7) 用户'root'@ localhost mysql错误1045拒绝访问 - access is denied for user 'root'@localhost mysql error 1045
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM