Mysql使用新的数据库位置创建数据库 [英] Mysql create database with new database location

查看:195
本文介绍了Mysql使用新的数据库位置创建数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几个月前,我曾问过关于如何在运行时更改数据库位置的问题 - 我没有得到任何解决方案的这个问题。



我需要在MySQL中创建超过32,000个数据库。 MySQL数据文件夹的默认数据位置,在该位置创建32,000个数据库后,我想将数据目录更改为其他位置。我计划通过Java代码来做到这一点。



但是之前,任何人都可以告诉我是否可以这样做?



<我真的需要实现这一点。请帮助我解决这个问题。



我很抱歉如果我不清楚这个描述中的任何地方,但是如果您需要更多信息,请告知我。

解决方案

您可以创建多个分区,并使用LVM(这在Linux中)加入它们,并将分区挂载到DATADIR路径。也可以使用数据库移动到其他文件夹/分区的软链接。



不幸的是MySQL只支持一个DATADIR,但在我看来,InnoDB表可以是分开的地方路径。你能检查一下吗?


Few months ago I have asked a question regarding how to change database location at runtime - I didn't get any solution for this problem yet.

I am needing to create more than 32,000 databases in MySQL. The default data location of MySQL data folder, after creating 32,000 database on that location, I want to change the data directory to other location. I am planning to do this through Java code.

But before that can anyone tell me if this is possible?

I am really needing to implement this as an requirement. Please help me out with this.

I am sorry If I am unclear anywhere in this description, but let me know if you all need any more information.

解决方案

You can create several partitions and join them using LVM (this is in Linux) and mount the partition to the DATADIR path. Also you can use soft links the the databases moved to other folders/partitions.

Unfortunately MySQL supports only one DATADIR but it seemed to me that InnoDB tables can be places to separate path. Could you check this?

这篇关于Mysql使用新的数据库位置创建数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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