创建用户并授权和改密码:
grant all privileges on *.* to root@'%' identified by '123456' with grant option;
 
 
*9FB2126F7514B6AF42B20E9E4B8E839B72E31
 
 
方法一:
#msyqladmin -uroot password nwepassword
#mysqladmin -uroot password oldpassword newpassword
 
 
方法二:
create user root1@'localhost';
set password for root@'%'=password("123456");
set password=password("123456");
 
方法三:
update mysql.user set password=password("123456") where user='root' and host='%';
updata mysql.user set password="*9FB2126F7514B6AF42B20E9E4B8E839B72E31" where user='root' and host='%';
 
 
刷新权限:
flush privileges;
 
 

mysql5.6 授权
密码不能和其他用户重复,否则无法登陆。

后来第二天再次测试又可以啦,但是发现秘密最后不能有#。

还遇到过不重启数据库密码不生效的情况。

总之已经懵逼了,估计是有bug。

反正授权时注意点就是了。

 
 
 

mysql多种方法修改密码----5.6的坑的更多相关文章

  1. 无法给MySQL root用户修改密码的解决方法

    本人编译安装完MySQL数据库,想给root用户修改密码,结果无法修改,并且报错,报错大概信息如下: mysqladmin: connect to server at 'localhost' fail ...

  2. mysql 5.7修改密码

    关闭正在运行的 MySQL : [root@www.woai.it ~]# service mysql stop 运行 [root@www.woai.it ~]# mysqld_safe --skip ...

  3. MYSQL 5.7 修改密码、登录问题

    mysql5.7 关于密码问题 报错: ERROR 1862 (HY000): Your password has expired. To log in you must change it usin ...

  4. MYSQL 5.7修改密码,登录问题

    mysql5.7 关于密码问题 报错: ERROR 1862 (HY000): Your password has expired. To log in you must change it usin ...

  5. Mysql关闭和修改密码

    数据库的关闭方法: 1.优雅的关闭数据库的方法:mysqladmin -uroot -p123456 shutdown 2.脚本关闭:/etc/init.d/mysqld stop 3.使用kill信 ...

  6. MYSQL 5.6修改密码

    忘记了超级用户root密码的时候怎么办呢? 1. 修改配置文件跳过密码 (1)编辑mysql主配置文件my.cnf # vim /etc/my.cnf 在[mysqld] 字段下添加参数 skip-g ...

  7. MySql数据库安装&修改密码&开启远程连接图解

    相关工具下载地址: mysql5.6 链接:http://pan.baidu.com/s/1o8ybn4I密码:aim1 SQLyog-12.0.8 链接:http://pan.baidu.com/s ...

  8. mysql client--笔记-修改密码-登录-查看数据库-创建数据库

    1 登录 mysql client 打开 mysql client -输入密码 123 回车 2 show database; ---显示数据库 3 切换数据库:use mysql 4 describ ...

  9. mysql查看和修改密码策略

    8.X版本: #查看密码策略 show variables like '%validate_password.policy%'; show variables like '%validate_pass ...

随机推荐

  1. Sharepoint 2010 创建栏 计算栏

    SharePoint 创建栏时,可以添加计算字段, 网上查了查,相关资料如下: http://wenku.baidu.com/view/936239e9b8f67c1cfad6b88f.html ht ...

  2. 59. 总结篇:数组中N(n=1,2,3)个只出现一次的数字[find N numbers which appear only once in array]

    [本文链接] http://www.cnblogs.com/hellogiser/p/find-n-numbers-which-appear-only-once-in-array.html [题目] ...

  3. 【转】solr+ajax智能拼音详解---solr跨域请求

    本文转自:http://blog.csdn.net/wangzhaodong001/article/details/8529090 最近刚做完solr的ajax智能拼音.总结一下. 前端:jQuery ...

  4. python 的类变量和对象变量

    python是一种解释性的语言,任何变量可以在使用的时候才声明以及定义,也可以在程序运行的任何位置进行声明和定义新的变量. class Man(object): #直接定义的类的变量,属于类 #其中 ...

  5. CodeIgniter - 集成七牛云存储

    最近有一个项目需要集成七牛云存储的图片存储和调用功能,程序是基于CodeIgniter2.1.3的PHP框架.刚拿到手完全无从下手的感觉,因为像框架这种东西,想从官方的PHPSDK集成进去,需要改动很 ...

  6. UML中的图的出现顺序

    上接:UML从需求到设计--用例 从开始接触UML到现在对UML逐渐有了更深入的了解.刚开始,对于UML总是感觉UML就是图.一提起UML 就想着这个是画图的东西. 具体这些图都是干什么的.为什么会有 ...

  7. vijos 1038 括号+路径 ***

    链接:点我 就是自己写不出来 #include <cstdio> #include <climits> #include <memory.h> using name ...

  8. Sonar相关资料

    Sonar介绍及安装:http://www.cnblogs.com/suncoolcat/p/3323200.html Sonar安装: http://www.myexception.cn/open- ...

  9. C++的那些事:const用法面面观

    一.const是什么 在 C/C++ 语言中,const关键字是一种修饰符.所谓“修饰符”,就是在编译器进行编译的过程中,给编译器一些“要求”或“提示”,但修饰符本身,并不产生任何实际代码.就 con ...

  10. c# 作业2

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...