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
   
    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
   查看日志(/var/log/mysqd.log)

160921 11:56:48 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
160921 11:56:48InnoDB: Initializing buffer pool, size = 8.0M
160921 11:56:48InnoDB: Completed initialization of buffer pool
160921 11:56:48InnoDB: 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:48InnoDB: 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 Plugin 'InnoDB' init function returned error.
160921 11:56:48 Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160921 11:56:48 Event Scheduler: Loaded 0 events
160921 11:56:48 /usr/libexec/mysqld: ready for connections.
Version: '5.1.71'socket: '/var/lib/mysql/mysql.sock'port: 3306Source distribution

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

ganluo960214 发表于 2016-09-21 17:32

/var/lib/mysql/mysql.sock
查看目录 查看权限 推荐/tmp/mysql.sock
页: [1]
查看完整版本: mysql裸存储问题