转自: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. yarn工具的使用

    <!-- yarn init === npm init --> <!-- yarn login === npm adduser -->登录 <!-- yarn publi ...

  2. ntpdate[31915]: the NTP socket is in use, exiting

    [root@master local]# ntpdate cn.pool.ntp.org 10 Oct 13:24:36 ntpdate[31915]: the NTP socket is in us ...

  3. ubuntu16安装MySQL

    MySQL 是一种开源数据库管理系统,通常作为流行的LAMP(Linux,Apache,MySQL,PHP / Python / Perl)堆栈的一部分安装.它使用关系数据库和SQL(结构化查询语言) ...

  4. 使用TensorFlow实现分类

    这一节使用TF搭建一个简单的神经网络用于分类任务,首先把需要的包引入,另外为了防止在多次运行中一些图中的tensor在内存中影响实验,采取重置操作: import tensorflow as tf i ...

  5. BZOJ1895Pku3580 supermemo——非旋转treap

    题目描述 给出一个初始序列fA1;A2;:::Ang,要求你编写程序支持如下操作: 1. ADDxyD:给子序列fAx:::Ayg的每个元素都加上D.例如对f1,2, 3,4,5g执行"AD ...

  6. BZOJ5372 PKUSC2018神仙的游戏(NTT)

    首先有一个想法,翻转串后直接卷积看有没有0匹配上1.但这是必要而不充分的因为在原串和翻转串中?不能同时取两个值. 先有一些结论: 如果s中长度为len的前缀是border,那么其存在|s|-len的循 ...

  7. SpringBoot+MyBatis多数据源使用分页插件PageHelper

    之前只用过单数据源下的分页插件,而且几乎不用配置.一个静态方法就能搞定. PageHelper.startPage(pageNum, pageSize); 后来使用了多数据源(不同的数据库),Page ...

  8. 【题解】Atcoder ARC#96 F-Sweet Alchemy

    首先,我们发现每一个节点所选择的次数不好直接算,因为要求一个节点被选择的次数大于等于父亲被选择的次数,且又要小于等于父亲被选择的次数 \(+D\).既然如此,考虑一棵差分的树,规定每一个节点被选择的次 ...

  9. ra (数论 , 莫比乌斯反演 , 整点统计)

    题意 求 \[\displaystyle \sum_{i=1}^{n} \sum_{j=1}^{n} [\mathrm{lcm} (i,j) > n] \pmod {10^9 + 7}\] . ...

  10. USACO 好题汇总

    背景 这里主要是用来针对USACO上的题目的二次汇总,因为我在刷题的过程中,有的题目我是可以很快想到解决方案的,对于这种题目,就没有必要深究了.但是有一些题目对于我来说还是有一些挑战的,可能用朴素的算 ...