Home  >  Q&A  >  body text

如何把3个不同的MySQL数据库数据整合到一个MySQL数据库中?

现在有3个网站分别是discuz,phpcms,thinkphp开发的,他们有各自的用户数据,想把这3个MySQL数据库中的数据整合起来放到一个数据库中,应该如何操作最好呢? 新建一个MYSQL数据库新设计数据表然后从3个原数据库中把数据读出来写进去么?

PHP中文网PHP中文网2742 days ago673

reply all(3)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 15:16:20

    I don’t know what you mean by integrating into one database. Do you mean changing three projects into a common database, or do you mean putting three databases on one machine?
    If it’s the former, I don’t feel good about it, because since there are three projects, the databases should be separated. Putting them in one database will cause conflicts in table names, etc., and it will be very troublesome to modify.
    If it is the latter, I don’t know if each of your projects is in the form of 1 master and n slaves. If so, you can first use a slave machine to merge the three data slaves together, and then perform the master From the switch, when switching the main database to the merged machine, the configuration differences of each previous server must also be taken into consideration.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 15:16:20

    Program integration, triggers, stored procedures, foreign keys, whatever you want

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 15:16:20

    The answer still needs research

    reply
    0
  • Cancelreply