MySQL社区

标题: 建表时指定data directory数据目录,提示目录被忽略 [打印本页]

作者: Light    时间: 2014-8-14 14:17
标题: 建表时指定data directory数据目录,提示目录被忽略
本帖最后由 Light 于 2014-8-14 15:25 编辑

问题如下:
  1. mysql> select version();
  2. +-----------+
  3. | version() |
  4. +-----------+
  5. | 5.1.73    |
  6. +-----------+
  7. 1 row in set (0.01 sec)

  8. mysql>create table tt (id int(10)) data directory='/db/data' index directory='/db/data';
  9. Query OK, 0 rows affected, 2 warnings (0.05 sec)

  10. mysql> show warnings;
  11. +---------+------+----------------------------------+
  12. | Level   | Code | Message                          |
  13. +---------+------+----------------------------------+
  14. | Warning | 1618 | <DATA DIRECTORY> option ignored  |
  15. | Warning | 1618 | <INDEX DIRECTORY> option ignored |
  16. +---------+------+----------------------------------+
  17. 2 rows in set (0.00 sec)
复制代码



file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\854999372\QQ\WinTemp\RichOle\1U85C649_6~6$DBJ1KVLZ66.jpg



作者: kider    时间: 2014-8-14 15:16
data_dir和index_dir都必须是绝对系统路径。另外目录MySQL一定要有访问权限。其他需要检查尝试一下...
作者: Light    时间: 2014-8-14 17:04
kider 发表于 2014-8-14 15:16
data_dir和index_dir都必须是绝对系统路径。另外目录MySQL一定要有访问权限。其他需要检查尝试一下...

用的是绝对路径,目录mysql用户也可访问

作者: kider    时间: 2014-8-14 18:14
试了试,我这儿可以:
  1. mysql> create table tt (id int(10)) data directory='/tmp/data' index directory='/tmp/data';
  2. Query OK, 0 rows affected (0.07 sec)
复制代码

先建立好data目录吧
作者: Light    时间: 2014-8-19 00:14
kider 发表于 2014-8-14 18:14
试了试,我这儿可以:

先建立好data目录吧

目录都是建了的,你的mysql是哪个版本的?

作者: yoon    时间: 2014-8-19 10:30
Light 发表于 2014-8-19 00:14
目录都是建了的,你的mysql是哪个版本的?

看下data目录权限

作者: kider    时间: 2014-8-19 11:08
Light 发表于 2014-8-19 00:14
目录都是建了的,你的mysql是哪个版本的?

与版本应该没有关系,5.1





欢迎光临 MySQL社区 (http://www.mysqlpub.com/) Powered by Discuz! X3.2