• XAMPP重置MySQL密码


      找到XAMPP的安装位置,这里以我的为例:C:xampp

      那么MySQL的路径:C:xamppmysql

      phpMyAdmin的路径:C:xamppphpMyAdmin

    修改MySQL密码

    第一步:

      通过XAMPP控制面板(XAMPP Control Panel)关闭MySQL服务(stop)。

    第二步:

      打开命令行终端,切换到目录:C:xamppmysqlin

    C:WindowsSystem32>cd C:xamppmysqlin
    
    C:xamppmysqlin>mysqld --skip-grant-tables
    2018-03-28 11:09:05 4200 [Note] mysqld (mysqld 10.1.19-MariaDB) starting as process 5716 ...

      输入命令后,窗口会进入无法操作的状态,此时MySQL也会启动,保持命令行终端窗口的状态,不要关闭。

    第三步:

      打开另一个命令行终端,同样切换到目录:C:xamppmysqlin

      依次输入命令如下:

    C:xamppmysqlin>mysql.exe -u root     # 以root用户登陆               
    Welcome to the MariaDB monitor.  Commands end with ; or g.
    Your MariaDB connection id is 2
    Server version: 10.1.19-MariaDB mariadb.org binary distribution
    
    Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    
    MariaDB [(none)]> use mysql          # 使用mysql数据库
    Database changed
    MariaDB [mysql]> update user set password=PASSWORD('root') where user='root';       # 更改密码 
    Query OK, 0 rows affected, 3 warnings (0.00 sec)
    Rows matched: 3  Changed: 0  Warnings: 3
    
    MariaDB [mysql]> flush privileges;      # 刷新权限
    Query OK, 0 rows affected, 12 warnings (0.02 sec)

      这样我们就成功的修改了MySQL的密码,这里设置为root,但是我们还需要修改phpMyAdmin的配置文件中的数据库连接密码,保证能正常连接数据库。

    修改phpMyAdmin配置文件

      修改C:xamppphpMyAdminconfig.inc.php中的为你想设置的密码。

    $cfg['Servers'][$i]['password'] = 'root';

      重启MySQL服务,便能使用新设置的密码使用了。

  • 相关阅读:
    Codeforces F. Bits And Pieces(位运算)
    一场comet常规赛的台前幕后
    【NOIP2019模拟2019.9.4】B(期望的线性性)
    「NOI2016」循环之美(小性质+min_25筛)
    【NOI2011】兔农(循环节)
    LOJ #6538. 烷基计数 加强版 加强版(生成函数,burnside引理,多项式牛顿迭代)
    noi2019感想
    7.12模拟T2(套路容斥+多项式求逆)
    CF 848E(动态规划+分治NTT)
    CF 398 E(动态规划)
  • 原文地址:https://www.cnblogs.com/Hi-blog/p/8662764.html
Copyright © 2020-2023  润新知