0

A buddy of mine needed help adding multiple directories to an SQL database while sharing the same schema yet have different listings. I've scoured my "MySQL" books and Google, I can't find any definitive information. I was just hoping someone here knew how to do this.

To clarify, there are a total of 12 directories. 11 are to be searched independently of one another and the 12th (which already exists) will be a directory comprised of all 11 directories, all of which will have the same schema. The goals are to create these unique directories using the existing schema model, and to upload multiple directory entries at a time to the directories. Does this mean the names of the directory entries have to be unique (ie. Name_1, Name_2, Name_3, etc...?) Or, will it be a matter of duplicating the schema under a different name? Any advise will help.

A directory, in this context, is like a roledex. I mean to have 12 roledexes with each rolodex having unique entries frem eachother. How do you approach this database-wise?

4

2 回答 2

1

登录到您的 PHPMyadmin 后,选择或进入您要复制和重命名的表,然后单击“操作”。在那里您会看到一系列框,其中一个称为“将表复制到(database.table)”您可以选择复制结构和数据,或仅复制结构。输入您想要的名称,然后单击开始。您的带有列表的新表格将可以编辑和搜索!

于 2012-06-09T20:23:07.167 回答
0

如果我理解您的要求...我认为您想为每个“目录”创建一个新数据库,正如您所说,其中包含相同的表定义。

mySQL 用语中的“数据库”一词与其他一些 RDBMS 系统用语中的“模式”含义相同。在同一个数据库(a/k/a 模式)中不能有两组具有相同表名的数据。为此,您需要不同的架构。

在单个服务器中拥有大量数据库并具有完全相同的表/列/键等是很常见的。是的,phpmyadmin 可以处理这个问题。

但是,“目录”这个词令人困惑。它通常指的是 mySQL (RDBMS) 服务器程序使用的磁盘数据存储。但我不认为这就是你的意思。如果您是认真的,请确保您在系统管理方面非常熟练,然后再尝试使用 mySQL 服务器上的文件系统。东西很容易坏。(问我怎么知道破坏东西是多么容易:-) :-)

于 2012-05-31T22:54:15.960 回答