使用
mysql_connect("localhost","root",“password“)连接显示
"failed to connect to mysql at 3306 with user root"
host pc is not allowed to connect to this masql server!
求大牛 指导
mysql_connect("localhost","root",“password“)连接显示
"failed to connect to mysql at 3306 with user root"
host pc is not allowed to connect to this masql server!
求大牛 指导
登入mysql,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,将"localhost"改称"%"
mysql -u root -pvmwaremysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>select host, user from user;
mysql的数据库下,看mysql这个库的use表,查看root的host值为什么,如果是localhost,应该就没什么问题。直接重启mysql服务再试看看。
grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option
我后来装了xp系统 一切都解决了 或许是win 7下设置的不好吧 !
密码 也是对的 就是不能使用mysql_connect() 悲剧
@net920 你的方法 我没早看到 要不我会试试的