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