mysql数据库内部root拒接访问库_访问被root用户拒绝,mysql数据库(access denied for user root, mysql database)...

访问被root用户拒绝,mysql数据库(access denied for user root, mysql database)

当我使用sequel pro连接到远程数据库时,服务器说访问被拒绝。 我100%确信用户名和密码是正确的。 我也尝试使用phpmyadmin连接到服务器,它的工作原理。 我不知道当我使用sequel pro连接到服务器时发生了什么。

when i am using sequel pro to connect to a remote database, the server says access denied. I am 100% percent sure that the username and password are correct. I also try to use phpmyadmin to connect to the server, it works. I don't know what happened when I am using sequel pro to connect to the server.

原文:https://stackoverflow.com/questions/2444974

更新时间:2020-01-26 17:52

最满意答案

mysql身份验证不仅取决于登录名和密码,还取决于主机。 用登录“root”和任何你想要和必要的密码(或任何“%”)主机创建另一个用户

mysql authentication depends not only of login + password but of host too. create another user with login "root" and any password you want and necessary (or any "%") host

2010-03-15

相关问答

MySQL 5.7在安装时自行生成随机root密码。 这是MySQL 5.7.4中的一个新变化,并在发行说明中进行了描述: https : //dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-4.html 安装过程只创建一个root帐户,“root”@“localhost”,自动为该帐户生成一个随机密码,并标记密码已过期。 MySQL管理员必须使用随机密码以root身份连接,并使用SET PASSWORD选择新密码。 (随机密码位于运行脚本的有效用

...

我之前看过这个错误,那是因为database.yml包含一些在文本编辑器的正常模式下无法看到的特殊字符。 我建议尝试从头开始创建全新的database.yml文件,然后再次手动输入数据库信息,重启服务器以检查结果。 I have seen this error before, that was because the database.yml contain some special characters that can't see in normal mode of text editor.

...

规则#1:不要在应用程序编程中使用root。 尝试使用mysql客户端和root密码登录数据库。 如果这不起作用,您可能必须重置root密码。 MySql文档有相关说明。 Rule #1: DO NOT USE root for application programming. Try logging onto the database using the mysql client and your root password. If that doesn't work, you may have

...

从文档中 , GRANT USAGE是: “没有权限”的同义词 撇开这个特权有一个令人困惑的名字这一点,我不知道为什么你为什么对root有这样有限的特权。 你想要的是GRANT ALL 。 更好的是,保持原样并创建一个具有本地访问权限的不同超级用户来替换root用户。 但请注意,一般来说,您只想为用户提供所需的最低限度特权。 From the docs, GRANT USAGE is a: Synonym for “no privileges” Leaving aside the point th

...

您以root身份登录MySQL并创建了新用户,但是您需要在以root用户身份登录时向新用户授予权限。 然后,您将能够以newuser和execute语句身份登录。 You logged into MySQL as root and created the new user, but you need to grant the permissions to the new user as well while logged in as root. Then you'll be able to log

...

在控制台中启动mysql客户端并执行此查询: select Host, User from mysql.user; 。 你必须有这样一行: +----------------+------------------+

| Host | User |

+----------------+------------------+

| localhost | root |

+----------------+-----

...

你正在尝试使用mysql交互式shell吗? 您可以在命令行中指定用户名: c:\> mysql -u root -p

哪里 -u = specify username

-p = prompt for password

You're trying to use the mysql interactive shell? You can specify usernames at the command line: c:\> mysql -u root -p

where -u = specify

...

mysql身份验证不仅取决于登录名和密码,还取决于主机。 用登录“root”和任何你想要和必要的密码(或任何“%”)主机创建另一个用户 mysql authentication depends not only of login + password but of host too. create another user with login "root" and any password you want and necessary (or any "%") host

您在前两个检查中分配值,而不是检查它们是否相等。 $a = 1; // assigning

$a == 1; // this is a check if 1 is $a is equal to 1

因此,您基本上将$ rpass值重置为''(空字符串): if ($rpass='leave blank if no password assigned')

{

$rpass='';

}

将您的支票更改为使用==,它将起作用。 请注意,从脚本使用root访问权限是一个巨大的安全隐患。 You'

...

为了它的价值,我忘记重置新安装的MySQL 5.7的用户名和密码,从这里注意到。 For what it worth, I forgot to reset the newly installed MySQL 5.7's username & password, noticed from here.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值