请问为什么我mysql本地非root无法连接 但是远程可以
迷茫
迷茫 2017-04-17 11:58:50
0
2
692

配置如图
root是系统账号 root0是应用登陆的一个只有CURD权限但是没有更改表结构的账号

现在是远程开发应用可以连接 远程可以通过sqlyogg连接 但是在数据库所在的主机上无法连接(root正常)

....www/data$ mysql -uroot0 -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root0'@'localhost' (using password: YES)

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
伊谢尔伦

I feel like localhost and 127.0.0.1 are duplicates. Try changing one first and see if it works.

巴扎黑

Is there any flush privileges?

My operations on this machine:

MariaDB [test]> create user 'h2'@'%' identified by 'h2';
Query OK, 0 rows affected (0.00 sec)

MariaDB [test]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [test]> select user, password, host from mysql.user where user = 'h2';
+------+-------------------------------------------+------+
| user | password                                  | host |
+------+-------------------------------------------+------+
| h2   | *196646D09F946D08C707DF3A0BCC3C9A2899E21B | %    |
+------+-------------------------------------------+------+
1 row in set (0.00 sec)

xxoo@localhost ~ % mysql -uh2 -p                                                                                                
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 969
Server version: 10.0.17-MariaDB-log MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]> exit
Bye

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!