简体   繁体   中英

How to import .sql file on the altered table?

I am working on PHP project, I use MYSQL at backend and I use XAMPP to work on my machine.

I have a copy of source code in my localhost and on the online server that is on hostgator.com.

I use localhost to test my source code and after finishing testing. I upload it on the online server(hostgator.com)

Recently I am facing a problem in Database.

I applied some alter table queries on few tables in my database. Now I exported the database in a SQL file from localhost and importing in on live server of hostagotor.

But 'import' action is showing error(Using PHPmyadmin to import queries) . It is saying that 'Column, Column_name was not found' , i know this error is because i applied some alter table queries on few tables.

Can you tell me if there is any shortcut so that, i dont have to write those alter table queries again on the live server.

One method is like You can create a new Database in your Live server & import the sql file you exported from localhost & change the DB configuration settings in your code.

Or

You'll have to find out the difference in DB columns between localhost & Live server and make changes accordingly.

A standalone PHP application http://code.google.com/p/phpmydiff/ ‎ helps to view differences between two MySQL databases. Compare the schema, data or both

After doing lot of research , i could not find out any shortcut. I wrote those alter table queries again on the table of new database and then imported the .sql file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM