mysql 授权 user@'%' 为什么登陆的时候localhost 不行呢???
公司业务服务器还没迁移到阿里云上的时候,创建的一个用户明明是所有的,但是本机登陆就是不行,一直也搞不懂原因
今天才知道 原来 %不包括 localhost
mysql> grant all on salt.* to salt@'%' identified by 'salt';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
[root@saltstack_s yum.repos.d]# mysql -u salt -psaltpasswd@123 -h localhost #登陆不了的原因。是因为上面授权的*不包括localhost
ERROR 1045 (28000): Access denied for user 'salt'@'localhost' (using password: YES)
[root@saltstack_s ~]# mysql -usalt -p -h 192.168.92.128
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, 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>
mysql 授权 user@'%' 为什么登陆的时候localhost 不行呢???的更多相关文章
- mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost'))
mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost')) 解决步骤: [====> ...
- Mysql授权GRANT ALL PRIVILEGES
1. 改表法. 可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 " ...
- MySQL 授权详解
(1)确认一下3306是否对外开放,mysql默认状态下是不开放对外访问功能的.查看的办法如下: 1 2 3 4 5 6 7 netstat -an | grep 3306 tcp 0 ...
- sql点滴43—mysql允许用户远程登陆
方法1 局域网连接mysql报错: ERROR 1130: Host '192.168.0.220' is not allowed to connect to this MySQL server 解 ...
- MySQL授权(用户权限)
一.mysql查询与权限 (二)授权 用户管理: 设置用户密码 前期准备工作: 停止服务 将配置文件当中的skip-grant-tables删除掉 重启服务: 执行修改命令 查看用户状态(如果数据过多 ...
- MYSQL设置远程账户登陆总结,mysql修改、找回密码、增加新用户,MySQL数据库的23个注意事项
1.5 设置及修改Mysql root用户密码1 设置密码方法mysqladmin -u root password '123456'mysqladmin -u root -p'123456' pas ...
- 专门讲讲这个MYSQL授权当中的with grant option的作用
对象的owner将权限赋予某个用户(如:testuser1) grant select ,update on bd_corp to testuser1 [with grant option ]1.如果 ...
- mySQL授权(让从服务器用户可以登录到主服务器)
mySQL授权(让从服务器用户可以登录到主服务器) 1.查看用户授权表 ? 1 select user,host,password from mysql.user; 2.给用户设置密码 ? 1 2 u ...
- MySQL的几种登陆方式
MySQL的几种登陆方式 登录方式一: [root@001 tmp]# mysql -h 127.0.0.1 -u root -p 这是最标准的登录方式,意指通过tTCP/IP协议进行连接,因为 ...
随机推荐
- SQL - 分页存储过程
http://www.jb51.net/article/71193.htm http://www.webdiyer.com/utils/spgenerator/ create PROCEDURE [d ...
- Excel操作类
'引入Excel的COM组件 Imports System Imports System.Data Imports System.Configuration Imports System.Web Im ...
- Java泛型总结
1. 什么是泛型?泛型(Generic type 或者 generics)是对 Java 语言的类型系统的一种扩展,以支持创建可以按类型进行参数化的类.可以把类型参数看作是使用参数化类型时指定的类型的 ...
- Leetcode | substr()
求子串当然最经典的就是KMP算法了.brute force算法在leetcode上貌似也有一些技巧. brute force: char* StrStr(const char *str, const ...
- MS14-025引起的问题 - 1
windows2008有一个叫组策略首选项(Group Policy Preference)的新特性.这个特性可以方便管理员在整个域内部署策略.本文会详细介绍这个组策略首选项的一些缺陷.尤其是当下发的 ...
- 8. Add the dashboard
Controller Node: 1. sudo apt-get install apache2 memcached libapache2-mod-wsgi openstack-dashboard ...
- 【iCore2模块】VGA模块样板谍照!
基于 iCore2 双核心板的 VGA模块样机做出来好久了,经过一个多月的努力奋战,该模块的代码已经写完,硬件也测试完毕,性能很好.下面贴几张图: 照片一: 为了节约时间,打样用的是绿色的板子,不过批 ...
- shopnc nginx优化配置文件
user www; worker_processes 2; error_log /var/log/nginx/error.log error; #error_log logs/error.log no ...
- ci获取当前url链接的分组,控制器,方法
public function role() { $ci= &get_instance();//ci控制器超级对象,就是把所有执行的方法打印出来 $directory = substr($ci ...
- gcc/g++链接时.o文件及库的顺序问题
折腾gcc/g++链接时.o文件及库的顺序问题 链接静态库的顺序问题 GCC 编译使用动态链接库和静态链接库--及先后顺序----及环境变量设置总结