转自:http://blog.sina.com.cn/s/blog_586a1f3e01000b82.html



刚使用mysql, 就老是碰到这个问题,真是郁闷, 终于找到原因..

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql

ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (usingpassword: N

O)



解决方法:

Step 1:

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -u root-p

Enter password: ******

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 28 to server version:5.0.24a-community-nt

Type 'help;' or '\h' for help. Type '\c' to clear thebuffer.

Step 2:

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql

mysql>status

正常使用....

------------------------------------------------

我的系统是ubuntu6.06,最近新装好的mysql在进入mysql工具时,总是有错误提示:

# mysql -uroot -p

Enter password:

ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using password: NO)



使用网上介绍的方法修改root用户的密码:

# mysqladmin -uroot -p password 'newpassword'

Enter password:

mysqladmin: connect to server at 'localhost' failed

error: 'Access denied for user 'root'@'localhost' (using password:YES)'



现在终于被我找到了解决方法,如下(请先测试方法三,谢谢!):

方法一:

# /etc/init.d/mysql stop

# mysqld_safe --user=mysql --skip-grant-tables --skip-networking&

# mysql -u root mysql

mysql> UPDATE user SET Password=PASSWORD('newpassword') whereUSER='root';

mysql> FLUSH PRIVILEGES;

mysql> quit



# /etc/init.d/mysql restart

# mysql -uroot -p

Enter password: <输入新设的密码newpassword>



mysql>





方法二:

直接使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码:

# mysql -udebian-sys-maint -p

Enter password: <输入[client]节的密码>

mysql> UPDATE user SET Password=PASSWORD('newpassword') whereUSER='root';

mysql> FLUSH PRIVILEGES;

mysql> quit



# mysql -uroot -p

Enter password: <输入新设的密码newpassword>



mysql>





方法三:

这种方法我没有进行过测试,因为我的root用户默认密码已经被我修改过了,那位有空测试一下,把结果告诉我,谢谢!!

# mysql -uroot -p

Enter password:<输入/etc/mysql/debian.cnf文件中[client]节提供的密码>



至此,困惑多时的问题解决了!

ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password:NO)的更多相关文章

  1. ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: N O) MYSQL

    ERROR 1045 (28000): Access denied for user ODBC@localhost 刚使用mysql, 碰到这个问题.. C:\Program Files\MySQL\ ...

  2. MySQL:ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)

    错误:ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO) 原因 :登录帐户错误(ODB ...

  3. ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: YES)

    ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO) ERROR 1045 (28000 ...

  4. Mysql忘记密码:关于ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)的问题

    命令行登录mysql时,出现ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)的提示. ...

  5. ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)

    cmd mysql -h localhost -u root -p r然后报错 ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost ...

  6. 密码正确 mysql无法登陆 red7.3 上安装mysql5.6后登录报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passswd :yes)

    集群需要mysql存储元数据,就在前几天还运行好好的,突然就进不去了......还是太菜,遇到的bug少. 引起这种故障的原因有很多......第一个坑比较多,大部分用户也就用第一个就可以解决问题,我 ...

  7. mysql ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)错误解决办法

    我的电脑是win10,所用的是mysql5.7.14 近期在学习mysql数据库的时候,遇到了这个错误,我的密码错误了.突如其来的问题,很是蒙蔽,因为我没对数据库设置过密码.通过网上查询,可以通过进入 ...

  8. ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO) ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: YES)

    windows下,以上两个错误的解决方法 工具/原料   windows 8 MySql 方法/步骤     找到配置文件my.ini  ,然后将其打开,可以选择用记事本打开   打开后,搜索mysq ...

  9. 登录mysql数据库出现 : ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO) ER或者忘记密码

    1.     在安装mysql的文件目录中找到配置文件my.ini  ,然后右击用记事本打开 2.     打开后,搜索mysqld关键字 找到后,在mysqld下面添加skip-grant-tabl ...

随机推荐

  1. [安全]appscan 使用代理抓取其他客户端的请求

    自己安全测试技能很低, 上级给的安全测试的任务给了自动化组的同事来做, 自己之前使用appscan的时候 只知道使用appscan的内置浏览器测试抓取请求 今天与自动化美女同事沟通发现有一个代理的功能 ...

  2. Node 多页面请求

    //功能:创建web服务器接收客户请求// http://127.0.0.1:8080/index 准备// http://127.0.0.1:8080/news 准备// public/index. ...

  3. python之tkinter使用-窗口居中显示

    # 窗口居中显示 import tkinter as tk def set_win_center(root, curWidth='', curHight=''): ''' 设置窗口大小,并居中显示 : ...

  4. codeforces437C

    The Child and Toy CodeForces - 437C On Children's Day, the child got a toy from Delayyy as a present ...

  5. 优步加入Linux基金会:支持开源

    导读 当地时间11月16日,优步在Uber Open Summit 2018年度峰会上宣布加入Linux基金会,并作为金级会员坚定支持对开源工具的使用和贡献. 优步CEO Thuan Pham将Lin ...

  6. linux 运维常用的一些命令收集

    1.删除0字节文件find -type f -size 0 -exec rm -rf {} ; 2.查看进程按内存从大到小排列ps -e   -o “%C   : %p : %z : %a”|sort ...

  7. 自学Aruba7.4-Aruba安全认证-MAC认证(web页面配置)

    点击返回:自学Aruba之路 自学Aruba7.4-Aruba安全认证-MAC认证(web页面配置) 由于前三节已经讲述了3种如何web页面配置安全认证,MAC认证就不过多讲解重复的步骤. 步骤1  ...

  8. 自学Zabbix12.3 Zabbix命令-zabbix_agentd

    点击返回:自学Zabbix之路 点击返回:自学Zabbix4.0之路 点击返回:自学zabbix集锦 自学Zabbix12.3 Zabbix命令-zabbix_agentd 1. zabbix_age ...

  9. nowcoder172A 中位数 (二分答案)

    二分一下答案,假设是x. 我们把大于x的看成1,小于x的看成-1,等于x的看成0 那某个区间的和如果是正的,就说明这个区间中位数大于x:如果是0,就等于x:如果是负的,就小于x: 这样的话,做一个前缀 ...

  10. sqlite 日期型 字符串转为日期型

    因为sqlite为弱引用,使用字段前将他强制转为日期型,用datetime.或者最原始的 strftime. SELECT distinct ID from testTable where datet ...