1、在安装mysql的过程中出现了错误,导致无法启动数据库
/usr/local/mysql/libexec/mysqld: File './mysql-bin.index' not found (Errcode: 13)
提示./mysql-bin.index无法找到(由于mysql开启了bin日志功能),到数据库根目录查看该文件是存在的,可能是文件权限的问题。
把权限更改下就好了
chown -R mysql.mysql /usr/local/mysql chown -R mysql.mysql /data/mysql_data/
2、把权限该了下,重新启动下mysql。居然发现还是不能启动数据库。
/usr/local/mysql/libexec/mysqld: Table 'mysql.plugin' doesn't exist 090810 11:02:56 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 090810 11:02:56 [ERROR] /usr/local/mysql/libexec/mysqld: unknown option '--skip-innodb' 090810 11:02:56 [ERROR] Aborting
网上找了下方法,没找到明确的解决方法,直接就用初始化脚本,进行了初始化。
/usr/local/mysql/bin/mysql_install_db --user=mysql --datadir=/data/mysql_data
3、初始化后居然又报错了。真心蛋疼
120710 11:01:38 InnoDB: Initializing buffer pool, size = 12.0G InnoDB: mmap(8791261184 bytes) failed; errno 12 120710 11:01:38 InnoDB: Completed initialization of buffer pool 120710 11:01:38 InnoDB: Fatal error: cannot allocate memory for the buffer pool 120710 11:01:38 [ERROR] Plugin 'InnoDB' init function returned error. 120710 11:01:38 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 120710 11:01:38 [ERROR] Unknown/unsupported storage engine: InnoDB 120710 11:01:38 [ERROR] Aborting
这个报错很明显了,是innodb的buffer pool太大导致的,改下配置文件。
4、改完后终于启动了。