• <bdo id='KiWjt'></bdo><ul id='KiWjt'></ul>

    <legend id='KiWjt'><style id='KiWjt'><dir id='KiWjt'><q id='KiWjt'></q></dir></style></legend>
    1. <i id='KiWjt'><tr id='KiWjt'><dt id='KiWjt'><q id='KiWjt'><span id='KiWjt'><b id='KiWjt'><form id='KiWjt'><ins id='KiWjt'></ins><ul id='KiWjt'></ul><sub id='KiWjt'></sub></form><legend id='KiWjt'></legend><bdo id='KiWjt'><pre id='KiWjt'><center id='KiWjt'></center></pre></bdo></b><th id='KiWjt'></th></span></q></dt></tr></i><div id='KiWjt'><tfoot id='KiWjt'></tfoot><dl id='KiWjt'><fieldset id='KiWjt'></fieldset></dl></div>
      <tfoot id='KiWjt'></tfoot>
    2. <small id='KiWjt'></small><noframes id='KiWjt'>

      1. mysql root密码忘记了

        时间:2023-06-02

        <small id='10Q9a'></small><noframes id='10Q9a'>

          <bdo id='10Q9a'></bdo><ul id='10Q9a'></ul>

            <tbody id='10Q9a'></tbody>

        • <legend id='10Q9a'><style id='10Q9a'><dir id='10Q9a'><q id='10Q9a'></q></dir></style></legend>
          <i id='10Q9a'><tr id='10Q9a'><dt id='10Q9a'><q id='10Q9a'><span id='10Q9a'><b id='10Q9a'><form id='10Q9a'><ins id='10Q9a'></ins><ul id='10Q9a'></ul><sub id='10Q9a'></sub></form><legend id='10Q9a'></legend><bdo id='10Q9a'><pre id='10Q9a'><center id='10Q9a'></center></pre></bdo></b><th id='10Q9a'></th></span></q></dt></tr></i><div id='10Q9a'><tfoot id='10Q9a'></tfoot><dl id='10Q9a'><fieldset id='10Q9a'></fieldset></dl></div>
          • <tfoot id='10Q9a'></tfoot>
                  本文介绍了mysql root密码忘记了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一段时间没有使用 PHP MySQL,现在我需要再次使用它.但问题是我忘记了 MySQL 控制台的密码.并在尝试登录 PHPMyAdmin 时出现错误 #1045.

                  在 MySQL 站点我看到一篇文章如何重置 root 密码(

                  在 Ubuntu 16 上,文件位置通常是 /etc/mysql/mysql.conf.d/mysqld.cnf

                  1. 使用以下命令编辑配置文件:$ sudo nano/etc/mysql/mysql.conf.d/mysqld.cnf

                  2. [mysqld] 块下添加 skip-grant-tables 并保存更改.

                  1. 使用以下命令重启 MySQL 服务:sudo service mysql restart

                  2. 检查 MySQL 服务状态:sudo service mysql status

                  1. 登录mysql:$ mysql -u root

                  2. 并更改root密码:

                  <块引用>

                  mysql> 刷新特权;

                  mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITHmysql_native_password BY 'MyNewPass';

                  1. 通过删除 skip-grant-tables 行或用 #(哈希)注释来恢复 MySQL 配置文件更改.

                  2. 最后重启 MySQL 服务,一切顺利.

                  I did not use PHP MySQL for quite a while and now I need to use it again. But the problem is I forget the password for the MySQL console. and getting error #1045 when trying to login in to PHPMyAdmin.

                  In the MySQL site I saw an article how to reset root password( http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-windows)

                  Steps are

                  create a mysql-init.txt file containing UPDATE mysql.user SET Password=PASSWORD('newpass') WHERE User='root';
                  FLUSH PRIVILEGES;
                  

                  I saved it as C:\me\mysql-init

                  and in command prompt I wrote--

                  C:\wamp\bin\mysql\mysql5.5.8\bin\mysqld --init-file=C:\me\mysql-init.txt 
                  

                  I tried with double backslashes also..but it is not working. MySQL console is asking for a password and it's not taking the new-one. What am I doing wrong? I have several tables there.what to do?

                  Thanks in advance.

                  解决方案

                  Here are the steps to be followed:

                  1. Locate the MySQL configuration file using: $ mysql --help | grep -A 1 "Default options"

                  On Ubuntu 16, the file location is typically /etc/mysql/mysql.conf.d/mysqld.cnf

                  1. Edit the configuration file using: $ sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf

                  2. Add skip-grant-tables under [mysqld] block and save the changes.

                  1. Restart MySQL service using: sudo service mysql restart

                  2. Check MySQL service status: sudo service mysql status

                  1. Login to mysql with: $ mysql -u root

                  2. And change the root password:

                  mysql> FLUSH PRIVILEGES;

                  mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'MyNewPass';

                  1. Revert back the MySQL configuration file changes by removing skip-grant-tables line or commenting it with a # (hash).

                  2. Finally restart the MySQL service and you are good to go.

                  这篇关于mysql root密码忘记了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何防止大型 MySQL 导入的连接超时 下一篇:按日期排序时间降序?

                  相关文章

                  1. <i id='IY1YB'><tr id='IY1YB'><dt id='IY1YB'><q id='IY1YB'><span id='IY1YB'><b id='IY1YB'><form id='IY1YB'><ins id='IY1YB'></ins><ul id='IY1YB'></ul><sub id='IY1YB'></sub></form><legend id='IY1YB'></legend><bdo id='IY1YB'><pre id='IY1YB'><center id='IY1YB'></center></pre></bdo></b><th id='IY1YB'></th></span></q></dt></tr></i><div id='IY1YB'><tfoot id='IY1YB'></tfoot><dl id='IY1YB'><fieldset id='IY1YB'></fieldset></dl></div>
                    <tfoot id='IY1YB'></tfoot>

                    <small id='IY1YB'></small><noframes id='IY1YB'>

                    <legend id='IY1YB'><style id='IY1YB'><dir id='IY1YB'><q id='IY1YB'></q></dir></style></legend>

                        <bdo id='IY1YB'></bdo><ul id='IY1YB'></ul>