Chinaunix

标题: mysql裸存储问题 [打印本页]

作者: 13913957501    时间: 2016-09-21 12:06
标题: mysql裸存储问题
新手刚接触mysql,安装遇到个问题:环境:虚拟机centos6.5 , mysql-server-5.1,裸存储即1G虚拟磁盘一块。


1、yum install mysql-server 正常

2、raw /dev/raw/raw1 /dev/sdb1 (sdb1是未格式化的分区)

    chown mysql.mysql /dev/raw/raw1
    chmod 660 /dev/raw/raw1

3、/etc/my.cnf
    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    innodb_data_home_dir=
    innodb_data_file_path=/dev/raw/raw2:500Mraw
    innodb_file_per_table=0
    innodb_log_group_home_dir=/var/lib/mysql/iblogs

4、mkdir -pv /var/lib/mysql/iblogs
    chown mysql.mysql /var/lib/mysql/iblogs

5、service mysqld start [ok]
     查看日志(/var/log/mysqd.log)

160921 11:56:48 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
160921 11:56:48  InnoDB: Initializing buffer pool, size = 8.0M
160921 11:56:48  InnoDB: Completed initialization of buffer pool
160921 11:56:48  InnoDB: Log file /var/lib/mysql/iblogs/ib_logfile0 did not exist: new to be created
InnoDB: Setting log file /var/lib/mysql/iblogs/ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
160921 11:56:48  InnoDB: Log file /var/lib/mysql/iblogs/ib_logfile1 did not exist: new to be created
InnoDB: Setting log file /var/lib/mysql/iblogs/ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...

InnoDB: Cannot initialize created log files because
InnoDB: data files are corrupt, or new data files were
InnoDB: created when the database was started previous
InnoDB: time but the database was not shut down
InnoDB: normally after that.
160921 11:56:48 [ERROR] Plugin 'InnoDB' init function returned error.
160921 11:56:48 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160921 11:56:48 [Note] Event Scheduler: Loaded 0 events
160921 11:56:48 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.71'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution

innodb初始化失败。
因为是新手,可能理解不到位,对于错误,请大家指教一下,谢谢!

作者: ganluo960214    时间: 2016-09-21 17:32
/var/lib/mysql/mysql.sock
查看目录 查看权限 推荐/tmp/mysql.sock




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2