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

今天才知道 原来 %不包括 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. Java如何获取系统cpu、内存、硬盘信息

    1 概述 前段时间摸索在Java中怎么获取系统信息包括cpu.内存.硬盘信息等,刚开始使用Java自带的包进行获取,但这样获取的内存信息不够准确并且容易出现找不到相应包等错误,所以后面使用sigar插 ...

  2. 将服务器上的某些特定日志统一保存至XPS文件

    <APACHost.CSV> Hostname,IP,OSType srv1,10.103.22.22,Win2003 srv2,10.103.22.37,Win2008   Import ...

  3. 获取Dell,Lenovo电脑的保修期

    2015-4-6写的代码(Dell), 不知道如何对报错进行友好化处理,于是采用了"非空"和"非空的补集"处理方式. $service = New-WebSer ...

  4. require(__DIR__ . "/../sss.php"

    魔法函数  __DIR__ 是 php5.2以后新加的函数,返回当前文件所在的目录,返回的目录不带 \,所以上边的意思是:Require当前目录的父目录中的 sss.php

  5. debug阶段工作期站立会议2(进度推进)

    组名:天天向上 组长:王森 组员:张政.张金生.林莉.胡丽娜 代码地址:HTTPS:https://git.coding.net/jx8zjs/llk.git SSH:git@git.coding.n ...

  6. SAE saestorage.class.php文件的封装代码

    Source for file saestorage.class.php Documentation is available at saestorage.class.php <?php /** ...

  7. angJs使选中的li背景颜色不同

    <!doctype html><html><head><meta charset="UTF-8"><title>test ...

  8. 关于Depth Bounds Test (DBT)和在CE3的运用

    Depth Bounds Test (DBT) Depth Bounds Test(深度范围检测),是Nvdia GeForce 6系列以后显卡的特性(GPU Programming Guide Ge ...

  9. The Dataflow Model 论文

    A Practical Approach to Balancing Correctness, Latency, and Cost in MassiveScale, Unbounded, OutofOr ...

  10. json 数组转换为js数组

    $(function(){ var json = '[{"id":"1","tagName":"apple"},{&qu ...