Chinaunix首页 | 论坛 | 博客
  • 博客访问: 492095
  • 博文数量: 99
  • 博客积分: 3621
  • 博客等级: 中校
  • 技术积分: 1089
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-22 16:29
文章存档

2012年(21)

2011年(28)

2010年(50)

分类: Mysql/postgreSQL

2012-03-05 16:56:54

  1. #错误提示
  2. mysql> CREATE TABLE ts (id INT, purchased DATE) engine=myisam
  3.     -> PARTITION BY RANGE(YEAR(purchased))
  4.     -> SUBPARTITION BY HASH(TO_DAYS(purchased))
  5.     -> (
  6.     -> PARTITION p0 VALUES LESS THAN (1990)
  7.     -> (
  8.     -> SUBPARTITION s0a
  9.     -> DATA DIRECTORY = '/home/bzuo/d1'
  10.     -> INDEX DIRECTORY = '/home/bzuo/d1',
  11.     -> SUBPARTITION s0b
  12.     -> DATA DIRECTORY = '/home/bzuo/d2'
  13.     -> INDEX DIRECTORY = '/home/bzuo/d2'
  14.     -> )
  15.     -> )
  16.     -> ;

  17. ERROR 1 (HY000): Can't create/write to file '/home/bzuo/d1/ts#P#p0#SP#s0a.MYI
  1. 目录权限
  2. drwxrwxrwx 2 mysql mysql 4096 Mar 4 23:33 d1
  3. drwxrwxrwx 2 mysql mysql 4096 Mar 4 23:21 d2

参考手册上说是可以的。

操作系统版本:

  1. [****]$ lsb_release -a
  2. LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
  3. Distributor ID: CentOS
  4. Description: CentOS release 5.7 (Final)
  5. Release: 5.7
  6. Codename: Final

在虚拟机上做测试是成功的,文件夹权限是777如下:

  1. mysql> CREATE TABLE ts (id INT, purchased DATE) engine=myisam
  2.     -> PARTITION BY RANGE(YEAR(purchased))
  3.     -> SUBPARTITION BY HASH(TO_DAYS(purchased))
  4.     -> (
  5.     -> PARTITION p0 VALUES LESS THAN (1990)
  6.     -> (
  7.     -> SUBPARTITION s0a
  8.     -> DATA DIRECTORY = '/home/zxy/d1'
  9.     -> INDEX DIRECTORY = '/home/zxy/d2',
  10.     -> SUBPARTITION s0b
  11.     -> DATA DIRECTORY = '/home/zxy/d1'
  12.     -> INDEX DIRECTORY = '/home/zxy/d2'
  13.     -> )
  14.     -> )
  15.     -> ;
  16. Query OK, 0 rows affected (0.48 sec)

虚拟机操作系统版本:

  1. [root@localhost ~]# lsb_release -a
  2. LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
  3. Distributor ID: CentOS
  4. Description: CentOS release 5.7 (Final)
  5. Release: 5.7
  6. Codename: Final

对比之后发现,是操作系统的问题。64位系统下不行,32位系统下可以。64位下不行的原因还未知,有知道的指点一下。

阅读(2213) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~