最近开始研究mysql,有一台服务器,第一次部署时有一些配置文件的路径有问题,打算重新部署,因为mysql用的二进制安装方式,删除了mysql目录,重新部署是报错:
# ./scripts/mysql_install_db --defaults-file=/etc/my.cnf --user=mysql
Installing MySQL system tables...2015-05-29 11:18:38 16020 [Note] InnoDB: The InnoDB memory heap is disabled
2015-05-29 11:18:38 16020 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-05-29 11:18:38 16020 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-05-29 11:18:38 16020 [Note] InnoDB: Using Linux native AIO
2015-05-29 11:18:38 16020 [Note] InnoDB: Using CPU crc32 instructions
2015-05-29 11:18:38 16020 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-05-29 11:18:38 16020 [Note] InnoDB: Completed initialization of buffer pool
2015-05-29 11:18:38 16020 [ERROR] InnoDB: ./ibdata1 can't be opened in read-write mode
2015-05-29 11:18:38 16020 [ERROR] InnoDB: The system tablespace must be writable!
2015-05-29 11:18:38 16020 [ERROR] Plugin 'InnoDB' init function returned error.
2015-05-29 11:18:38 16020 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2015-05-29 11:18:38 16020 [ERROR] Unknown/unsupported storage engine: InnoDB
2015-05-29 11:18:38 16020 [ERROR] Aborting
2015-05-29 11:18:38 16020 [Note] Binlog end
2015-05-29 11:18:38 16020 [Note] ./bin/mysqld: Shutdown complete
看着很像权限的问题,但是检查后发现,权限很正常,google一下
原来是datadir下的问题,删除data目录下的ib_logfile0和ib_logfile1文件,就可以了,因为是重新部署,所以我把datadir清空了,再次执行安装脚本,成功,make一下。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14184018/viewspace-1676475/,如需转载,请注明出处,否则将追究法律责任。