好久没实用MySQL了,上次由于装了Banq的论坛系统。在用MySQL Administrator进去的时候居然提示mysql error number 1045 access denied for user 'admin'@'localhost' (using password: YES)的错误,看来密码是对了,username错了。最后发现自己居然犯了个第几错误,username应该是root,唉!

  同一时候找了别人的资料。一起发上来。供下次使用。

  Access denied for user ''@'localhost' to database

  我在Suse Linux 10.2下用自带光盘用Yast2安装Mysql 5.0, 装好后在终端输入mysql, mysql

  成功启动。退出,再输入 mysqladmin -u root password XXXXX。 出现错误: mysqladmin: connect to server at 'localhost' failed

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

  如先输入mysql,成功启动后输入use mysql,出现例如以下错误:Access denied for user ''@'localhost' to database 'mysql'

  还有。输mysql能够,输mysql -u root就出错了:

  Access denied for user 'root'@'localhost' (using password: NO).

  The reason is:

  是昨日更新ROOTpassword时出错

  update user set password = '123456' where user ="root" //这样写是错的,密码事实上不是123456

  应该为update user set password = password ('123456') where user = "root"

  详细操作步骤:

  关闭mysql:

  # service mysqld stop

  然后:

  # mysqld_safe --skip-grant-tables

  启动mysql:

  # service mysqld start

  mysql -u root

  mysql> use mysql

  mysql> UPDATE user SET Password=PASSWORD('xxx') WHERE user='root';

  mysql> flush privileges;

  mysql>\q

  That's it. I hope those above could do a little favor for you!

版权声明:本文博客原创文章,博客,未经同意,不得转载。

Suse发生了错误Access denied for user ''@'localhost' to&的更多相关文章

  1. phpMyAdmin出现错误 Access denied for user 'root'@'localhost' (using password: NO)

    今天安装wmpp,之后启动后点击phpMyAdmin 报拒绝连接错误:#1045 - Access denied for user 'root'@'localhost' (using password ...

  2. eclipse不正常编译导致错误:Access denied for user 'root'@'localhost' (using password: YES)

    使用eclipse连接mysql报错:Access denied for user 'root'@'localhost' (using password: YES) 连接代码没有任何问题,网上找了很多 ...

  3. mysql将某数据库的全部权限赋给某用户,提示1044错误Access denied

    mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; ERROR 1044 (4 ...

  4. mysql错误 Access denied for user 'root'@'xxx.xxx.xxx.xxx' (using password: YES)

    mysql -u root -p Aaa111222333 grant all privileges on *.* to root@'%' identified by 'aaa111222333; Q ...

  5. Centos7 nginx提示错误 Access denied.

    SELinux will cause this error on CentOS/RHEL 7+ by default :( CentOS/RHEL 7+ 系统默认会因为SELinux出现这个报错 To ...

  6. C# 删除文件错误 access denied

    使用以下代码正常删除整个文件夹内容时,报错如下: if (backupPathDir.Exists) { System.IO.DirectoryInfo di = new DirectoryInfo( ...

  7. centos7下nginx添加到自定义系统服务中提示Access denied

    安装好nginx后,添加到系统服务中 在/usr/lib/systemd/system下创建nginx.service文件内容如下: [Unit] Description=nginx - high p ...

  8. 本地MySQL的root所创建用户登录发生[Access denied for user 'root1'@'localhost' (using password: YES)]错误的解决方案

    1.问题描述: 当在SQLyog中执行以下脚本: CREATE DATABASE IF NOT EXISTS sys; USE sys; CREATE USER root1 IDENTIFIED BY ...

  9. Django链接Mysql 8.0 出现错误(1045:Access denied for user 'root'@'localhost' (using password: NO) 的一种解决方法

    运行环境: Django版本2.0 ; Mysql 版本 8.0.11; 错误代码:  django.db.utils.OperationalError: (1045:Access denied fo ...

随机推荐

  1. 高速幂 POW优化

    #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h&g ...

  2. C++出现计算机术语5

    class template(类模板) 可以用来定义一个类定义了一组特定类型的类的.类模板template keyword其次是尖括号(<>)附上.的列表来定义. export keywo ...

  3. oracle转Mysql中,varchar2(10)和number应该转换为什么类型? (转)

    一. varchar2(10)和number应该转换为什么类型? oracle转成mysql时:varchar2(10)可以转成varchar(10)number则要看oracle中存储的具体是什么类 ...

  4. Android:刚6瓶啤酒4两56度白酒下肚,竟然20分钟做了一手机版站点 !

    刚6瓶啤酒4两56度白酒下肚,竟然20分钟不到时间做了一手机版站点 !人有多大潜力你知道吗? 大家有兴趣的能够用手机或微信打开 http://xh.yunxunmi.com/  看看俺这酒后之做! 很 ...

  5. 安装sunvirtualbox

    按照网友提供的方法安装sunvirtualbox,老提示:依赖关系不满足: libpython2.6 (>= 2.6) 后来用终端运行 sudo apt-get install virtualb ...

  6. 这么多的技术,作为一个freshman,什么研究?

    科学技术,从哪里学习?        杨问了我几个最近:"如何学习技术?".说实话,其实,我自己只是一个资深兄弟.对于这个答案.这是更难以在本身回答. 可是.既然比师弟们多吃了几年 ...

  7. 如何自动以管理员身份运行.NET程序?

    原文:如何自动以管理员身份运行.NET程序? windows 7和vista提高的系统的安全性,同时需要明确指定“以管理员身份运行”才可赋予被运行软件比较高级的权限,比如访问注册表等.否则,当以普通身 ...

  8. Android KitKat 4.4 Wifi移植AP模式和网络共享的调试日志

    Tethering技术在移动平台上已经运用的越来越广泛了.它能够把移动设备当做一个接入点,其它的设备能够通过Wi-Fi.USB或是Bluetooth等方式连接到此移动设备.在Android中能够将Wi ...

  9. SQLSERVER2014的内存优化表

    SQL Server 2014中的内存引擎(代号为Hekaton)将OLTP提升到了新的高度. 现在,存储引擎已整合进当前的数据库管理系统,而使用先进内存技术来支持大规模OLTP工作负载. 就算如此, ...

  10. MongoDB学习笔记-维护

    主从复制 MongoDB有主从复制技术,解决高可用和容灾问题,也就是备份. 配置主从的特点: N 个节点的集群 任何节点可作为主节点 所有写入操作都在主节点上 自动故障转移 自动恢复 数据分布式存储 ...