我尝试使用DATA DIRECTORY命令创建一个新的InnoDB表,将.ibd文件放在另一个驱动器上。我在CentOS上,使用Percona MySQL 5.6.27,我启用了innodb_file_per_table。以下是我正在运行的命令:
CREATE TABLE `xxx` (
`log_id` bigint(20) NOT NULL AUTO_INCREMENT,
`campaign_id` int(11) NOT NULL,
`subscriber_id` int(11) NOT NULL,
`message` text,
`processed` enum('yes','no') NOT NULL DEFAULT 'no',
`retries` int(1) NOT NULL DEFAULT '0',
`max_retries` int(1) NOT NULL DEFAULT '3',
`email_message_id` varchar(255) DEFAULT NULL,
`status` char(15) NOT NULL DEFAULT 'success',
`date_added` datetime NOT NULL,
PRIMARY KEY (`log_id`),
KEY `fk_campaign_delivery_log_archive_list_subscriber1_idx` (`subscriber_id`),
KEY `fk_campaign_delivery_log_archive_campaign1_idx` (`campaign_id`),
KEY `sub_proc_status` (`subscriber_id`,`processed`,`status`),
KEY `email_message_id` (`email_message_id`)
) ENGINE=InnoDB AUTO_INCREMENT=150095504 DEFAULT CHARSET=utf8 DATA DIRECTORY='/mysql/archive/'
这会在phpmyadmin中抛出#1030 - Got error -1 from storage engine
。查看MySQL错误日志,这是错误:
InnoDB: Error: Write to file ./abc/xxx.isl failed at offset 0.
InnoDB: 62 bytes should have been written, only 0 were written.
InnoDB: Operating system error number 22.
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 22 means 'Invalid argument'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
我在没有CREATE TABLE
的情况下测试了DATA DIRECTORY
代码,它运行正常。
我在chown
上完成/mysql/archive
并将其设置为mysql:mysql,因此mysql可以访问该文件夹。我还确认/mysql/archive
有足够的空白空间。
我尝试修改/etc/my.cnf
并设置innodb_use_native_aio = 0
,但这并没有帮助。
有什么建议吗?
谢谢!
答案 0 :(得分:0)
发现了什么问题。显然,如https://bugs.mysql.com/bug.php?id=79200所述,innoDB 5.6.26+中存在一个错误。我不得不删除innodb_flush_method = O_DIRECT