zoukankan      html  css  js  c++  java
  • 1045 access denied for user 'root'@'localhost' using password yes

    这两个在安装mysql数据库碰到一些头疼的很。

       "1045 access denied for user 'root'@'localhost' using password yes"

    在命令行中进入:C:Program FilesMySQLMySQL Server 5.5in

    C:Program FilesMySQLMySQL Server 5.1in>mysqld  --defaults-file="C:Program FilesMySQLMySQL Server 5.5inmy.ini" --console --skip-grant-tables

    090515 22:06:09 [ERROR] The update log is no longer supported by MySQL in versio
    n 5.0 and above. It is replaced by the binary log. Now starting MySQL with --log
    -bin='' instead.
    090515 22:06:09  InnoDB: Started; log sequence number 0 324221
    090515 22:06:09 [Note] mysqld: ready for connections.
    Version: '5.1.33-community-log'  socket: ''  port: 3306  MySQL Community Server
    (GPL)

    看到这个结果就说明MySQL已经起来了。
    再开一个DOS窗口,同样切到mysql bin目录下,

    输入

    mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’; 
    mysql> FLUSH PRIVILEGES; 
    mysql> quit 

    然后
    C:Program FilesMySQLMySQL Server 5.5in>mysqladmin shutdown
    之后正常重启MySQL服务就行了。

    配置好最后点击 Execute 按钮了,但是进行不到 Start service 这一步。

    检查了下 MySQL 系统服务已添加,但是无法启动,手工也不行。这时候用事件查看器可以看到程序事件里有几个来自于 MySQL 的错误: 

    Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 
    Unknown/unsupported table type: INNODB 

    原来是因为这两版本的 MySQL 默认使用了支持事物的 INNODB 引擎,打开 my.ini 文件,在 MySQL 的安装文件夹, 如 C:Program FilesMySQLMySQL Server 5.5in 中,看到: 

    default-storage-engine=INNODB 

    解决办法是把该设置改为 

    default-storage-engine=MYISAM 

    如果还是不行则找到:skip-innodb 取消注销,后在服务中手动启动。

    注:主要参考http://bbs.csdn.net/topics/310006640

  • 相关阅读:
    二.线性表
    一.绪论
    托管服务器代码
    jquery easyui DataGrid 数据表格 属性
    用socket 模拟http请求
    struct和class的相同点与不同点
    c++中的基本数据类型
    当函数返回一个局部变量的指针问题,内存是否被释放
    Python首先生成包含1000个随机字符的字符串,然后统计每个字符的出现次数。(使用字典)
    浅谈结构体字节的求法
  • 原文地址:https://www.cnblogs.com/whroid/p/3868833.html
Copyright © 2011-2022 走看看