数据目录MySQL [英] DATA DIRECTORY MySQL
问题描述
查询:
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
为什么我有此错误:
DATA DIRECTORY的参数不正确
推荐答案
DATA DIRECTORY通过创建符号链接来工作,该符号链接通常从表的原位置(在datadir内部)到选项指定的位置.出于安全原因,为避免绕过特权系统,服务器不允许datadir内部的符号链接.因此,DATA DIRECTORY不能用于指定datadir内部的位置.尝试这样做将导致错误1210(HY000)DATA DIRECTORY的参数不正确.
DATA DIRECTORY works by creating symlinks from where the table would normally have been (inside the datadir) to where the option specifies. For security reasons, to avoid bypassing the privilege system, the server does not permit symlinks inside the datadir. Therefore, DATA DIRECTORY cannot be used to specify a location inside the datadir. An attempt to do so will result in an error 1210 (HY000) Incorrect arguments to DATA DIRECTORY.
https://mariadb.com/kb/zh/library/create-table/#data-directoryindex-directory
您的数据目录位于/var/lib/mysql/
中,请尝试其他位置,例如/var/shop
Your DATA DIRECTORY is in /var/lib/mysql/
, try a different location, for example /var/shop
这篇关于数据目录MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!