Mysqli与PHP的连接 [英] Mysqli Connection with PHP

查看:56
本文介绍了Mysqli与PHP的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力建立与mysql的连接,到目前为止,我最终遇到此错误:

I'm trying so hard to make connection to mysql, and so far I end up with this error :

  Warning: mysqli_connect(): (HY000/1045): Access denied for user 'dev'@'localhost'         (using password: YES) in D:\Programs\Xamp\htdocs\series\dynamic\AtomCMS\setup.php on line 5
Could not connect because: Access denied for user 'dev'@'localhost' (using password: YES)

我刚刚开始开发一个新的基于Web的系统,这是我用来连接数据库的代码.任何帮助表示赞赏.

I've just started developing a new web based system and here is the code I used to make connection to the database. Any help is appreciated.

$dbc = mysqli_connect('localhost','dev','123','pouya')OR die('Could not connect because: '.mysqli_connect_error());

此致

推荐答案

如果您使用的是XAMPP,请使用
[localhost/phpmyadmin]
打开phpmyadmin界面. 1)在选择您要访问的数据库后,您将在右侧获得一个选项,该选项卡名为特权.
2)您需要检查该用户是否存在.如果不存在,请创建用户dev.如果该用户存在,请尝试重新创建,因为您使用的是错误的密码.

In case you are using XAMPP then open the phpmyadmin interface using
[localhost/phpmyadmin]
1) On selecting the database you want to access.You get an option on right having a tab called privileges.
2) You need to check whether the user exist.If not Create a user dev.If the user exist try to recreate as you may be using a wrong password.

这篇关于Mysqli与PHP的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆