<tfoot id='A6vbz'></tfoot>

      1. <legend id='A6vbz'><style id='A6vbz'><dir id='A6vbz'><q id='A6vbz'></q></dir></style></legend>

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

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

        MYSQL 错误 1045 拒绝访问

        时间:2024-04-16

          <i id='HYxL7'><tr id='HYxL7'><dt id='HYxL7'><q id='HYxL7'><span id='HYxL7'><b id='HYxL7'><form id='HYxL7'><ins id='HYxL7'></ins><ul id='HYxL7'></ul><sub id='HYxL7'></sub></form><legend id='HYxL7'></legend><bdo id='HYxL7'><pre id='HYxL7'><center id='HYxL7'></center></pre></bdo></b><th id='HYxL7'></th></span></q></dt></tr></i><div id='HYxL7'><tfoot id='HYxL7'></tfoot><dl id='HYxL7'><fieldset id='HYxL7'></fieldset></dl></div>
          • <bdo id='HYxL7'></bdo><ul id='HYxL7'></ul>
                <tfoot id='HYxL7'></tfoot>
                <legend id='HYxL7'><style id='HYxL7'><dir id='HYxL7'><q id='HYxL7'></q></dir></style></legend>

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

                    <tbody id='HYxL7'></tbody>
                  本文介绍了MYSQL 错误 1045 拒绝访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我刚买了一个新的 macbook pro (OS X 10.8.2),我正在尝试在它上面设置 mysql.到目前为止,我已经能够安装它,但我无法获得我的 root 用户访问权限(或任何与此相关的用户).我计划将它用于 Python,在我的另一台计算机上我只使用 MYSQL(没有 MAMP),我更喜欢保持这种方式.

                  I just got a new macbook pro (OS X 10.8.2) and am attempting to get mysql set up on it. So far I've been able to get it installed but I cannot get my root user access (or any user for that matter). I plan on using this for Python, on my other computer I only use MYSQL (no MAMP) and I prefer to keep it that way.

                  作为参考,我做了以下事情:

                  For reference, I did the following:

                  $ alias mysql=/usr/local/mysql/bin/mysql$ sudo/Library/StartupItems/MySQLCOM/MySQLCOM start$别名mysqladmin=/usr/local/mysql/bin/mysqladmin

                  当我输入 mysqlmysql -u root -p 它给我这个:

                  When i enter mysql or mysql -u root -p it gives me this:

                  ERROR 1045 (28000): Access denied for user 'root'@'localhost'(使用密码:YES)

                  ERROR 1045 (28000): Access denied for user 'jmitch'@'localhost' (using password: NO)取决于我使用的措辞

                  MYSQL 正在我的系统首选项中运行.感谢您的帮助.

                  MYSQL is running in my system preferences. Thank you for your help.

                  推荐答案

                  可能是更新包更新程序覆盖了 root 密码.

                  Maybe updating the package the updater overwrote the root password.

                  要恢复它:

                  停止 mysqld 守护进程.

                  Stop mysqld deamons.

                  $ sudo service mysqld stop
                  

                  进入mysql/bin目录

                  Go to mysql/bin directory

                  $ cd /usr/bin
                  

                  用这个选项启动一个 mysql 守护进程:

                  Start a mysql deamon with this option:

                  $ sudo mysqld_safe --skip-grant-tables
                  

                  打开另一个终端并打开一个mysql会话来执行这个:

                  Open another terminal and open a mysql session to execute this:

                  $ mysql
                  
                  mysql> use mysql;
                  
                  see Note1 below for next line.
                  mysql> UPDATE user SET password=PASSWORD('YOUR_NEW_PASSWORD_HERE') WHERE user = 'root';
                  
                  mysql> exit;
                  

                  现在杀死mysqld_safe进程并正常重启mysqld:

                  Now kill the mysqld_safe process and restart mysqld normally:

                  $ sudo service mysqld start
                  

                  注1: password是5.7版本之前mysql.user表中的列名.之后它变成了authentication_string.相应地更改您的更新声明.

                  Note1: password is the column name in table mysql.user prior to version 5.7. After which it became authentication_string. Change your update statement accordingly.

                  这篇关于MYSQL 错误 1045 拒绝访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 MySQL 中创建一个连续的组? 下一篇:用户“root"@“localhost"的访问被拒绝 - 终端,Mac

                  相关文章

                  <tfoot id='WanGL'></tfoot>

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

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

                    <legend id='WanGL'><style id='WanGL'><dir id='WanGL'><q id='WanGL'></q></dir></style></legend>
                    • <bdo id='WanGL'></bdo><ul id='WanGL'></ul>