sudo mysqld --debug
2016-06-06 11:02:35 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2016-06-06 11:02:35 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-06-06 11:02:35 0 [Note] mysqld (mysqld 5.6.30-0ubuntu0.14.04.1) starting as process 25351 ...
2016-06-06 11:02:35 25351 [Warning] Can't create test file /mnt/01D0900CA5E8F760/ProgramData/MySQL/MySQLServer5.6/ashish-ratan.lower-test
2016-06-06 11:02:35 25351 [Warning] Can't create test file /mnt/01D0900CA5E8F760/ProgramData/MySQL/MySQLServer5.6/ashish-ratan.lower-test
mysqld 配置:
[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
#datadir = /var/lib/mysql
datadir =/mnt/01D0900CA5E8F760/ProgramData/MySQL/MySQLServer5.6
tmpdir = /tmp
我到底有什么
在 Linux 中使用 Windows mysql 数据目录,因为我已将我的大型数据库上传到 NTFS,现在我想在 Linux 中使用该目录。
答案1
更改数据目录后,您需要更改 Apparmor 设置以解决权限问题
- 打开
/etc/apparmor.d/usr.sbin.mysqld
- 注释掉
/var/lib/mysql/ r, /var/lib/mysql/** rwk,
- 然后
/mnt/01D0900CA5E8F760/ProgramData/MySQL/MySQLServer5.6/ r, /mnt/01D0900CA5E8F760/ProgramData/MySQL/MySQLServer5.6/** rwk,
- 还要确保正确授予数据目录权限。
- 尝试再次重新启动 MySQL 服务。
答案2
Ashish,请确保您的 NTFS 分区已使用读写选项安装。您可以/dev/sda1
使用以下命令安装您的 NTFS 分区。
sudo mkdir /mnt/ntfs/
sudo mount -t ntfs-3g /dev/sda1 /mnt/ntfs/