我的是xp系统,mysql的服务死活启动不了,用的都是集成环境(XAMPP,WAMP)都是同样的问题。
2014-03-26 14:26:59 5792 [Note] Plugin 'FEDERATED' is disabled.
2014-03-26 14:26:59 5792 [Note] InnoDB: The InnoDB memory heap is disabled
2014-03-26 14:26:59 5792 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2014-03-26 14:26:59 5792 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-03-26 14:26:59 5792 [Note] InnoDB: Not using CPU crc32 instructions
2014-03-26 14:26:59 5792 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-03-26 14:26:59 5792 [Note] InnoDB: Completed initialization of buffer pool
2014-03-26 14:26:59 5792 [Note] InnoDB: Highest supported file format is Barracuda.
2014-03-26 14:26:59 5792 [Note] InnoDB: The log sequence numbers 0 and 0 in ibdata files do not match the log sequence number 1600607 in the ib_logfiles!
2014-03-26 14:26:59 5792 [Note] InnoDB: Database was not shutdown normally!
2014-03-26 14:26:59 5792 [Note] InnoDB: Starting crash recovery.
2014-03-26 14:26:59 5792 [Note] InnoDB: Reading tablespace information from the .ibd files...
2014-03-26 14:26:59 5792 [Note] InnoDB: Restoring possible half-written data pages 
2014-03-26 14:26:59 5792 [Note] InnoDB: from the doublewrite buffer...
2014-03-26 14:26:59 5792 [Note] InnoDB: 128 rollback segment(s) are active.
2014-03-26 14:26:59 5792 [Note] InnoDB: Waiting for purge to start
2014-03-26 14:26:59 5792 [Note] InnoDB: 5.6.12 started; log sequence number 1600607
2014-03-26 14:26:59 5792 [Note] Server hostname (bind-address): '*'; port: 3306
2014-03-26 14:27:01 5792 [Note] IPv6 is not available.
2014-03-26 14:27:01 5792 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
2014-03-26 14:27:01 5792 [Note] Server socket created on IP: '0.0.0.0'.
2014-03-26 14:27:01 5792 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
这是错误日志,在网上看了很多帖子都说是 data目录或者my.ini 路径的问题,但是我的都是新装的绝对不会存在路径问题两天了,求助高人解决。难道只能重装系统了吗?

解决方案 »

  1.   

    你的系统用户表不存在,如果是误删除,看看能否找回
    如果找不到,重装mysql
      

  2.   

    C:\wamp\bin\mysql\mysql5.6.12\data\mysql  目录下存在的  user.frm   user.MYD    user.MYImy.ini 中路径也没有错
    basedir=c:/wamp/bin/mysql/mysql5.6.12
    log-error=c:/wamp/logs/mysql.log
    datadir=c:/wamp/bin/mysql/mysql5.6.12/data
    而且搜索过了没有其他的my.ini 就这一个经过cmd验证还是有问题 
    C:\wamp\bin\mysql\mysql5.6.12\bin>mysqld --defaults-extra-file=C:/wamp/bin/mysql/mysql5.6.12/my.ini
    所以路径和文件不存在是不可能的。
      

  3.   

    是误删除ibdata1这个文件而引起的,解决办法是重装Mysql
      

  4.   


    如果你是这情况的话,点击MySql 出现这个,然后查看Windows 事件查看器--》点击日志名称(应用程序),查看最近的一条MYSQL错误信息,类似是这样的
    日志名称:          Application
    来源:            MySQL
    日期:            2014/5/16 17:58:52
    事件 ID:         100
    任务类别:          无
    级别:            错误
    关键字:           经典
    用户:            暂缺
    计算机:           xx-PC
    描述:
    InnoDB: Attempted to open a previously opened tablespace. Previous tablespace mysql/innodb_table_stats uses space ID: 1 at filepath: .\mysql\innodb_table_stats.ibd. Cannot open tablespace wordpress/wp_users which uses space ID: 1 at filepath: .\wordpress\wp_users.ibdFor more information, see Help and Support Center at http://www.mysql.com.  
    事件 Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="MySQL" />
        <EventID Qualifiers="49152">100</EventID>
        <Level>2</Level>
        <Task>0</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2014-05-16T09:58:52.000000000Z" />
        <EventRecordID>69205</EventRecordID>
        <Channel>Application</Channel>
        <Computer>xx-PC</Computer>
        <Security />
      </System>
      <EventData>
        <Data>InnoDB: Attempted to open a previously opened tablespace. Previous tablespace mysql/innodb_table_stats uses space ID: 1 at filepath: .\mysql\innodb_table_stats.ibd. Cannot open tablespace wordpress/wp_users which uses space ID: 1 at filepath: .\wordpress\wp_users.ibd</Data>
      </EventData>
    </Event>可以采用我这个方法,点击XAMMP 程序文件目录下的 my.ini,文件在[mysqld]节点下,最后一行输入
    innodb_force_recovery = 1,然后重启服务即可。
      

  5.   

    刚刚在写入的时候,发现写入不了,于是百度了一下,原来那个默认值为0,大于0的都不能使用Insert 、updata、delete操作。改为0即可
      

  6.   

    删除ib_logfile0,ib_logfile1,ibdata1等文件,重新启动mysql服务。