• windows 下 mysql设置初始密码


    1.先在安装目录找到my.ini配置文件,打开配置文件,找到[mysqld]一行,在下面添加skip-grant-tables后保存该文件,重新启mysql动服务。

    2.执行 mysql -u root -p    密码为空,直接回车;

    usemysql

    mysql>update mysql.user set authentication_string=password('123456') where user='root' and Host ='localhost';

     mysql>Flush privileges;

    其中newpassword为root的新密码。

    (可能先前的版本密码的抬头是password,5.7.11是 authentication_string,可以select * from user,查看一下)

    (老版本)update user set password=password("123456") where user="root";

    (5.7.11)update user set authentication_string=password("123456") where user="root";


    3.将刚才my.ini配置文件添加的那一行去掉,重启mysql。

  • 相关阅读:
    css定位
    表格常见属性
    细说Ajax--异步请求
    DOM事件与jQuery事件的是非纠葛
    简单特效-切换背景图片
    javascript之--offset家族
    javascript高级特性
    参数的传递
    javascript中函数浅析
    初识Javascript
  • 原文地址:https://www.cnblogs.com/zhangxiangdong/p/8986152.html
Copyright © 2020-2023  润新知