公司业务服务器还没迁移到阿里云上的时候,创建的一个用户明明是所有的,但是本机登陆就是不行,一直也搞不懂原因

今天才知道 原来 %不包括 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 不行呢???的更多相关文章

  1. mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost'))

    mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost')) 解决步骤: [====> ...

  2. Mysql授权GRANT ALL PRIVILEGES

    1. 改表法. 可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 " ...

  3. MySQL 授权详解

    (1)确认一下3306是否对外开放,mysql默认状态下是不开放对外访问功能的.查看的办法如下: 1 2 3 4 5 6 7 netstat -an | grep 3306 tcp        0  ...

  4. sql点滴43—mysql允许用户远程登陆

     方法1 局域网连接mysql报错: ERROR 1130: Host '192.168.0.220' is not allowed to connect to this MySQL server 解 ...

  5. MySQL授权(用户权限)

    一.mysql查询与权限 (二)授权 用户管理: 设置用户密码 前期准备工作: 停止服务 将配置文件当中的skip-grant-tables删除掉 重启服务: 执行修改命令 查看用户状态(如果数据过多 ...

  6. MYSQL设置远程账户登陆总结,mysql修改、找回密码、增加新用户,MySQL数据库的23个注意事项

    1.5 设置及修改Mysql root用户密码1 设置密码方法mysqladmin -u root password '123456'mysqladmin -u root -p'123456' pas ...

  7. 专门讲讲这个MYSQL授权当中的with grant option的作用

    对象的owner将权限赋予某个用户(如:testuser1) grant select ,update on bd_corp to testuser1 [with grant option ]1.如果 ...

  8. mySQL授权(让从服务器用户可以登录到主服务器)

    mySQL授权(让从服务器用户可以登录到主服务器) 1.查看用户授权表 ? 1 select user,host,password from mysql.user; 2.给用户设置密码 ? 1 2 u ...

  9. MySQL的几种登陆方式

    MySQL的几种登陆方式 登录方式一:    [root@001 tmp]# mysql -h 127.0.0.1 -u root -p 这是最标准的登录方式,意指通过tTCP/IP协议进行连接,因为 ...

随机推荐

  1. Intel OIT demo

    https://software.intel.com/en-us/blogs/2013/07/18/order-independent-transparency-approximation-with- ...

  2. BKDRhash实现

    参考了一些有关于哈希算法的博客,里面都有提到BKDR哈希算法,在博客:各种字符串Hash函数中有对各种hash算法进行测试,测试关于哈希冲突,以及散列的质量,得到的结果可以参考以上博文. BKDRha ...

  3. python twisted启动定时服务

    以下是python脚本send_mms.py #############################################!/usr/bin/python# -*- coding: ut ...

  4. 【翻译】CEDEC2014 CAPCOM 照相机正确的照片真实的制作工作流

     这次带来的翻译是Capcom在CEDEC2014上发表的技术美术相关的资料.资料的目的,就是在已经拥有了一套基于物理的渲染引擎的前提下,如何进行图片真实的材料的拍摄并制作为引擎里的材质,以及如何正确 ...

  5. Note: RewriteCond规则

    如果文件存在,就直接访问文件,不进行下面的RewriteRule:RewriteCond %{REQUEST_FILENAME} !-f 如果目录存在,就直接访问目录,不进行下面的RewriteRul ...

  6. placeholder属性实现text标签默认值提示用户

    <input type="text" class="searchTxt" id=this.id+"-searchTxt" placeh ...

  7. 用宏 x y z,找出最大值最小值

    #define max(x,y,z) ((x)>(y)?(x):(y))>(z)?((x)>(y)?(x):(y)):(z) #define min(x,y,z) ((x)<( ...

  8. nginx下使用memcache

    nginx配置支持memcache,但不支持写,支持读,所以读取部分由程序设置,整个代码如下nginx的server段配置如下:#将静态文件放入memcachelocation ~* \.(gif|j ...

  9. SET ? DECLARE

    http://dev.mysql.com/doc/refman/5.7/en/declare-local-variable.html http://dev.mysql.com/doc/refman/5 ...

  10. 安装faac编译问题

    mpeg4ip.h:126: error: new declaration ‘char* strcasestr(const char*, const char*)’分类: Linux开发相关 2012 ...