错误 1045 (28000): 用户 'root'@'localhost' 的访问被拒绝(使用密码:是) [英] ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

查看:65
本文介绍了错误 1045 (28000): 用户 'root'@'localhost' 的访问被拒绝(使用密码:是)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在按照手册在 Ubuntu 上安装软件套件.我对MySQL一无所知.我在我的 Ubuntu 上完成了以下安装.

I have been following a manual to install a software suite on Ubuntu. I have no knowledge of MySQL at all. I have done the following installations on my Ubuntu.

sudo apt-get update
sudo apt-get install mysql-server-5.5
sudo apt-get install mysql-client-5.5
sudo apt-get install mysql-common
sudo apt-get install glade
sudo apt-get install ntp

那我做

cd ~/Desktop/iPDC-v1.3.1/DBServer-1.1
mysql -uroot -proot <"Db.sql"

我最终得到以下错误消息.

I ended up with the following error message.

ERROR 1045 (28000): 拒绝用户 'root'@'localhost' 访问(使用密码:YES)

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

我该如何解决它并继续?

How may I fix it and continue?

推荐答案

注意:对于MySQL 5.7+,请查看来自拉希鲁的回答对这个问题.其中包含更多最新信息.

Note: For MySQL 5.7+, please see the answer from Lahiru to this question. That contains more current information.

对于 MySQL

5.7:

For MySQL < 5.7:

默认的 root 密码为空白(即空字符串),而不是 root.所以你可以登录为:

The default root password is blank (i.e., an empty string), not root. So you can just log in as:

mysql -u root

你显然应该在安装后更改你的root密码:

You should obviously change your root password after installation:

mysqladmin -u root password [newpassword]

在大多数情况下,您还应该在广泛使用数据库之前设置个人用户帐户.

In most cases you should also set up individual user accounts before working extensively with the database as well.

这篇关于错误 1045 (28000): 用户 'root'@'localhost' 的访问被拒绝(使用密码:是)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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