Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql Sql客户端抛出错误1045,但我可以通过命令行进入吗?_Mysql_Sql_Linux_Ubuntu - Fatal编程技术网

Mysql Sql客户端抛出错误1045,但我可以通过命令行进入吗?

Mysql Sql客户端抛出错误1045,但我可以通过命令行进入吗?,mysql,sql,linux,ubuntu,Mysql,Sql,Linux,Ubuntu,我有一个linux VPS,我可以使用命令行连接到fine root@vps27625:~# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4604 Server version: 5.5.38-0ubuntu0.14.04.1 (Ubuntu) Copyright (c) 2000, 2014, Ora

我有一个linux VPS,我可以使用命令行连接到fine

root@vps27625:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4604
Server version: 5.5.38-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
但如果我使用任何sql客户机,它会抛出错误1045拒绝用户root的访问(使用密码:YES)


发生这种情况的可能原因是什么?

您似乎在远程使用root。默认情况下,大多数mysql安装都拒绝了这一点。因此,请改用其他用户


实际上,使用root帐户远程登录不是一个好的做法。

mysql服务器上的root远程登录被禁用。您可以使用

>mysql\u安全安装


命令来启用或禁用它

它与你所允许的无关。如果您禁止root远程连接,您将被拒绝访问。使用另一个mysql帐户怎么样?顺便说一句,使用root进行远程连接不是一个好的做法。我使用了另一个用户,这很有效。使用root进行远程登录不是一个好的做法。这就是它在默认情况下被禁用的原因