新建了一个mysql用户,但是无法在本地登录,即使已经授权任一ip都可以登录,甚至特地写清楚localhost登录,还是不行,情况如下

[root@localhost zabbix-release-3.2]# mysql -ubiaopei -p
Enter password:
ERROR 1045 (28000): Access denied for user 'biaopei'@'localhost' (using password: YES) #输入密码报错,但是在其他电脑上输入这个密码后可以正常登录

网上的解决方法乱七八糟的,以后有空再慢慢研究吧。我的解决方法是,不输入密码,直接回车

情况如下

[root@localhost zabbix-release-3.2]# mysql -ubiaopei -p
Enter password: #不输密码可以正常登录
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 64
Server version: 5.5.52-MariaDB MariaDB Server Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>

后来也发现,直接回车也不行,需要把允许ip范围改成下面的样子即%才可以

MariaDB [(none)]> select user,host from mysql.user;
+---------+-------------+
| user | host |
+---------+-------------+
| biaopei | % | #运行所有ip地址登录
| root | 127.0.0.1 |
| biaopei | 192.168.2.% |
| root | ::1 |
| root | localhost |
+---------+-------------+
5 rows in set (0.00 sec) MariaDB [(none)]>

最新文章

  1. 在Windows环境中开始Docker的学习和体验
  2. WebGIS中矢量切图的初步研究
  3. XSS攻击及防御
  4. CoreOS Hyper-V 安装
  5. Mybatis添加返回主键ID
  6. 性能指标TP99之我解
  7. CSS3:过渡大全
  8. mysql创建视图
  9. 安装hbase-0.98.9-hadoop2
  10. c++算术运算时数据类型提升带来的问题
  11. Hbase与RDBMS
  12. Redis应用----消息传递
  13. The Beam Model:Stream & Tables翻译(上)
  14. Express static 托管静态文件 理解
  15. Win7或Win8上安装VS2015报“安装包丢失或损坏”问题的解决办法
  16. akka pubsub example
  17. MySQL/Oracle视图的创建与使用
  18. 在arcgis使用python脚本进行字段计算时是如何解决中文问题的
  19. Altium Designer 13 插件安装
  20. ss is one another utility to investigate sockets(特适合大规模tcp链接)

热门文章

  1. 最完整的mac安装caffe
  2. Linux学习: 触摸屏驱动
  3. mybatis动态sql #和$的区别
  4. 用FPGA对ASIC进行原型验证的过程(转)
  5. 用户登录页面——jdbc
  6. 前端小白凭什么杀进 BAT?
  7. day 42 mysql 数据类型
  8. Java学习笔记22(List接口)
  9. SSH连接虚拟机中的Ubuntu(转)
  10. python socket 编程之三:长连接、短连接以及心跳(转药师Aric的文章)