源码编译安装之后,启动数据库失败,日志如下,哪位老大帮忙看一下130103 21:09:23 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
130103 21:09:24  InnoDB: Initializing buffer pool, size = 16.0M
130103 21:09:24  InnoDB: Completed initialization of buffer pool
InnoDB: Error: auto-extending data file /usr/local/mysql/data/ibdata1 is of a different size
InnoDB: 0 pages (rounded down to MB) than specified in the .cnf file:
InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages!
InnoDB: Could not open or create data files.
InnoDB: If you tried to add new data files, and it failed here,
InnoDB: you should now edit innodb_data_file_path in my.cnf back
InnoDB: to what it was, and remove the new ibdata files InnoDB created
InnoDB: in this failed attempt. InnoDB only wrote those files full of
InnoDB: zeros, but did not yet use them in any way. But be careful: do not
InnoDB: remove old data files which contain your precious data!
130103 21:09:24 [ERROR] Plugin 'InnoDB' init function returned error.
130103 21:09:24 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130103 21:09:24 [ERROR] Unknown/unsupported storage engine: InnoDB
130103 21:09:24 [ERROR] Aborting

解决方案 »

  1.   

    删除那个 ibdata* 的文件。
      

  2.   

    看看你的my.cnf中的datadir配置的是否有问题
      

  3.   


    删除这个文件之后,启动错误提示是这样的130104 09:46:44 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
    InnoDB: The InnoDB memory heap is disabled
    InnoDB: Mutexes and rw_locks use InnoDB's own implementation
    InnoDB: Compressed tables use zlib 1.2.3
    130104  9:46:44  InnoDB: Initializing buffer pool, size = 16.0M
    130104  9:46:44  InnoDB: Completed initialization of buffer pool
    InnoDB: The first specified data file /usr/local/mysql/data/ibdata1 did not exist:
    InnoDB: a new database to be created!
    130104  9:46:44  InnoDB: Setting file /usr/local/mysql/data/ibdata1 size to 10 MB
    InnoDB: Database physically writes the file full: wait...
    130104  9:46:44  InnoDB: Error: Write to file /usr/local/mysql/data/ibdata1 failed at offset 0 0.
    InnoDB: 1048576 bytes should have been written, only -1 were written.
    InnoDB: Operating system error number 28.
    InnoDB: Check that your OS and file system support files of this size.
    InnoDB: Check also that the disk is not full or a disk quota exceeded.
    InnoDB: Error number 28 means 'No space left on device'.
    InnoDB: So130104 09:46:44 mysqld_safe mysqld from pid file /usr/local/mysql/data/localhost.localdomain.pid ended
      

  4.   


    路径配置的没有问题啊innodb_data_home_dir = /usr/local/mysql/data
    innodb_data_file_path = ibdata1:10M:autoextend
    innodb_log_group_home_dir = /usr/local/mysql/data
      

  5.   

    130104  9:46:44  InnoDB: Error: Write to file /usr/local/mysql/data/ibdata1 failed at offset 0 0.
    你的账号有写/usr/local/mysql/data/权限吗?
      

  6.   


    drwxr-xr-x  5 mysql mysql   4096 01-04 09:46 data
      

  7.   

    已经搞定了,原来是磁盘空间不足,感谢acmain提示