简体   繁体   English

数据目录MySQL

[英]DATA DIRECTORY MySQL

query: 查询:

CREATE TABLE IF NOT EXISTS `shop_product`
DATA DIRECTORY = '/var/lib/mysql/shop/'
INDEX DIRECTORY='/var/lib/mysql/shop/'
ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1

why i have this error: 为什么我有这个错误:

Incorrect arguments to DATA DIRECTORY DATA DIRECTORY的参数不正确

You've got at least two problems here. 您这里至少有两个问题。 First, your table doesn't have any columns. 首先,您的表没有任何列。 Second, you can't use DATA DIRECTORY or INDEX DIRECTORY with InnoDB. 其次,您不能在InnoDB中使用DATA DIRECTORYINDEX DIRECTORY

Also, beginning with MySQL 5.0.60, you cannot use path names that contain the MySQL data directory with DATA DIRECTORY or INDEX DIRECTORY . 另外,从MySQL 5.0.60开始,您不能使用包含MySQL数据目录的路径名和DATA DIRECTORYINDEX DIRECTORY I'm guessing that /var/lib/mysql is your MySQL data directory? 我猜想/var/lib/mysql是您的MySQL数据目录?

DATA DIRECTORY works by creating symlinks from where the table would normally have been (inside the datadir) to where the option specifies. DATA DIRECTORY通过创建符号链接来工作,该符号链接通常从表的原位置(在datadir内部)到选项指定的位置。 For security reasons, to avoid bypassing the privilege system, the server does not permit symlinks inside the datadir. 出于安全原因,为避免绕过特权系统,服务器不允许datadir内部的符号链接。 Therefore, DATA DIRECTORY cannot be used to specify a location inside the datadir. 因此,DATA DIRECTORY不能用于指定datadir内部的位置。 An attempt to do so will result in an error 1210 (HY000) Incorrect arguments to DATA DIRECTORY. 尝试这样做将导致错误1210(HY000)DATA DIRECTORY的不正确参数。

https://mariadb.com/kb/en/library/create-table/#data-directoryindex-directory https://mariadb.com/kb/zh-CN/library/create-table/#data-directoryindex-directory

Your DATA DIRECTORY is in /var/lib/mysql/ , try a different location, for example /var/shop 您的数据目录位于/var/lib/mysql/ ,请尝试其他位置,例如/var/shop

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM