Mac系统下迁移MySQL 8数据目录至外部磁盘失败的问题求助
Mac系统下迁移MySQL 8数据目录至外部磁盘失败的问题求助
大家好,我刚在Mac上安装了MySQL 8.2,它默认把数据存在/usr/local/mysql/data/目录下,这个目录的所有者是_mysql用户和_mysql用户组。我在外接硬盘的根目录新建了一个数据目录,然后通过系统设置把MySQL的数据目录指向了这个外接硬盘上的文件夹。
结果这么操作之后,服务器根本启动不了,下面是错误日志:
2023-11-20T08:28:39.195307Z 0 [System] [MY-010116] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.2.0) starting as process 3811 2023-11-20T08:28:39.224697Z 0 [Warning] [MY-010091] [Server] Can't create test file /Volumes/MacExternal/MySQL/mysqld_tmp_file_case_insensitive_test.lower-test 2023-11-20T08:28:39.224723Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /Volumes/MacExternal/MySQL/ is case insensitive mysqld: File './binlog.index' not found (OS errno 1 - Operation not permitted) 2023-11-20T08:28:39.232188Z 0 [ERROR] [MY-010119] [Server] Aborting 2023-11-20T08:28:39.232340Z 0 [System] [MY-010910] [Server] /usr/local/mysql/bin/mysqld: Shutdown complete (mysqld 8.2.0) MySQL Community Server - GPL. 2023-11-20T08:28:39.233095Z 0 [System] [MY-015016] [Server] MySQL Server - end.
我试过把/Volumes/MacExternal/MySQL/的权限改成777,但问题还是一样。我甚至尝试修改这个外接目录的所有者:
sudo chown _mysql:_mysql MySQL
但执行完命令后什么反应都没有,完全没生效。有没有大佬知道我该怎么顺利迁移数据库目录呀?
备注:内容来源于stack exchange,提问作者user3523426
相关产品推荐
相关产品推荐

