dtkyayvldeaqhl7151 2014-08-06 21:51
浏览 43
已采纳

将MySQL结构导入实时SQL数据库

I have a client with a big database. I took their existing site and created a development site. I took a copy of their existing database and made multiple name changes. By name changes, I mean changing the column names, not the the field type, no adding primary/foreign keys etc. With the new changes, is it possible to import and update the column names? I'm using PHPmyAdmin.

Example structure for one of my tables.

old:

Column  Type            Null    Default
form    varchar(5000)    No 
date    datetime         No 

New one to update:

Column      Type          Null  Default
ind_Form    varchar(5000)  No   
ind_Date    datetime       No   
bus_ID      int(11)        No   

Is this something I can do easily with phpmyadmins import functionality? Or is this something that where I have to change the column names manually? Any help would be greatly appreciated

  • 写回答

1条回答 默认 最新

  • doushang9172 2014-08-06 22:30
    关注

    The easiest and most consistent way I think would be creating a script to do it.

    I would create another copy of the live database and start writing a script using ALTER TABLE statements to make the necessary changes to the database so that it matches the new schema you are trying to emulate.

    Get it perfect using copies of the live database so you can be sure it will work correctly, and then run it on the live database.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab实现基于主成分变换的图像融合。
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊