0

I have an issue. I am trying to create an installer for my content management system, that will make the process as simple and painless as possible. The upload size is around 8mb. I have a script that will process the sql file, but it does not allow ';' in strings, and this is no good for me. It also takes around an hour to process all queries.

Is there any way that I could import the sql file, in a short amount of time, and allow ';'s, within a varchar?

hughes
  • 5,595
  • 3
  • 39
  • 55
Jarrod
  • 322
  • 1
  • 3
  • 13
  • See my answer to [Running MySQL *.sql files in PHP](http://stackoverflow.com/questions/4027769/running-mysql-sql-files-in-php/4028289#4028289) and also other answers I link to from that one. I'm not sure if it's exactly a duplicate, because you don't mention PHP. But the principle applies no matter what language you're using. – Bill Karwin May 21 '14 at 19:28

2 Answers2

0

I think that you need to specify something like:

delimiter $$

At the beginning of your script and than restore:

delimiter ;

At the end of the script. This will manage ; as a normal char during your import.

kiks73
  • 3,718
  • 3
  • 25
  • 52
  • Thankyou for your fast reply! So, I would add this at the top of my sql file? Or within the PHP import? – Jarrod May 21 '14 at 19:23
  • At the beginning of the sql file and restore it at the end. This is normally used when you write a stored procedure in mysql to avoid partial execution of the script. – kiks73 May 21 '14 at 19:24
  • Sounds like the OP has some custom script that processes the .sql file, splits it on `;` and runs each statement. `DELIMITER` is a builtin command of the mysql client, and is not recognized by the MySQL server SQL parser. So I don't think this answer will help. – Bill Karwin May 21 '14 at 19:30
  • Ah, ok, I didn't know that DELIMITER was a mysql client command. – kiks73 May 21 '14 at 19:33
0

mysql.ini - 8m change to 200m(as we need)

cmd: mysql -u username -p databasename < sqlFile.sql

https://stackoverflow.com/a/36737350/6223123

Community
  • 1
  • 1
Kavin D
  • 1
  • 6