外部硬盘驱动器上的MySQL表 [英] MySQL tables on external hard drive

查看:73
本文介绍了外部硬盘驱动器上的MySQL表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要导入到MySQL中的大量文本数据.我在MacBook上进行此操作,但没有足够的空间,因此我想将其存储在外部硬盘驱动器中(此时我并不真正担心速度-只是用于测试).

最好的方法是什么?

  • 在外部硬盘驱动器上安装MySQL(在Mac上可以吗?)
  • 在笔记本电脑的硬盘驱动器上安装MySQL,并将表放在外部(如何?)

解决方案

一个简单的技巧是创建一个符号链接,以替换当前指向外部磁盘的mysql数据库文件位置.Google符号链接.

示例用法是在关闭mysql,将旧的mysql db文件夹名称更改为其他名称并使用ln命令创建符号链接后,如下所示:

  ln -s [外部驱动器路径] [MYSQL DB文件夹路径] 

然后将mysql db文件夹的所有先前内容移动到新位置.

I have a large amount of text data I need to import into MySQL. I'm doing this on a MacBook and don't have enough space for it so I want to store it in an external hard drive (I'm not really concerned about speed at this point - this is just for testing).

What's the best way to do it?

  • Install MySQL on the external hard drive (is this possible on a Mac?)
  • Install MySQL on the laptop's hard drive and have the tables on the external (how?)

解决方案

One simple hack is to create an symbolic link replacing your current mysql database file location pointing to the external disk. Google symbolic link.

sample usage would be after you shutdown mysql, change the old mysql db folder name to something else, and create the symbolic link using the ln command like below

ln -s [EXTERNAL DRIVE PATH] [MYSQL DB FOLDER PATH]

Then move all the previous content of the mysql db folder to the new location.

这篇关于外部硬盘驱动器上的MySQL表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆