0

I know similar questions have been asked, and answers state to use the --force or -f parameter in the console window, which I just can't use.
My PHP script generates an .sql file for updating a database of a new shop with the data of an old shop (different but similar systems, almost identical database structures).
This .sql file then needs to be imported in the new database using phpMyAdmin (or similar software running in a web browser), so I just can't use any console options.
I already use CREATE TABLE IF NOT EXISTS and INSERT IGNORE INTO to avoid errors on multiple imports, but I still don't have a solution for ignoring ALTER TABLE table ADD column statements.

My thoughts on this now go in a direction, where the force option might be set in the beginning of the .sql file like a variable using the /!xxxxx syntax like /!40101 SET NAMES utf8 */;, but I can't seem t find any information on that.
Does anyone know the syntax to use if any exists?
Thanks a lot in advance!

Spider IT
  • 73
  • 1
  • 10
  • either (A) create the stored proc or have it exist ahead of time in the script, or (B) look at the answer from user rahvin_t in the dupe target – Drew Oct 15 '16 at 06:47
  • One can't create a stored procedure in a webhoster's database. I need a solution where the force switch is in the .sql file. And that has never been asked or answered before, so no duplicate. – Spider IT Oct 16 '16 at 05:20
  • There is info in that dupe that shows it not in a stored proc. You never said that a stored proc could not be created. But I chose that dupe because there was an answer in there that shows a non stored proc. – Drew Oct 16 '16 at 05:24
  • 1
    Thanks, Drew, I must have missed that one (the answer from rahvin_t), and it seems to work perfektly. – Spider IT Oct 18 '16 at 08:41

0 Answers0