简体   繁体   English

MySQL连接失败

[英]MySQL Connection Failed

I want to build a website on Ubuntu 14. I have apache, PHP and Mysql installed on it. 我想在Ubuntu 14上建立一个网站。我已经安装了Apache,PHP和Mysql。

I'm using PHP to connect to Mysql but got the error information as follows: 我正在使用PHP连接到Mysql,但收到以下错误信息:

Connection Failed: SQLSTATE[28000][1045] Access denied for user 'root'@'localhost'

Anyone know how to fix it? 谁知道怎么修它?

Probabbly Wrong Password issue or you didn't set the password for root yet. 可能是密码输入错误,或者您尚未为root设置密码。 Try login from terminal using mysql -u root -p and it will asking your current root password. 尝试从终端使用mysql -u root -p登录,它将询问您当前的root密码。

If you are running a website, do not using root access for your website user access. 如果您正在运行网站,请不要将root用户访问权限用于网站用户访问。 Create an account with access to specified database. 创建一个有权访问指定数据库的帐户。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM