473,324 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

innodb and php

348 100+
Hi all,

I have a question regarding php and mysql. What I have is a php backup script that dumps the data in the form of INSERT INTO ...

I am using innodb and foreign key constraints. When the user downloads the sql file for the db, the tables are not in the order that they need to be for the restore. The restores will always fail because of the foreign key constraints.

I am developing on a windows machine and will host in a UNIX environment. In the mean time, can someone tell me how I can inplement this code using php to turn off the constraints?

Expand|Select|Wrap|Line Numbers
  1.  (
  2. echo "SET AUTOCOMMIT=0;"
  3. echo "SET FOREIGN_KEY_CHECKS=0;"
  4. cat databasedump.sql
  5. echo "SET FOREIGN_KEY_CHECKS=1;"
  6. echo "COMMIT;"
  7. echo "SET AUTOCOMMIT=1;"
  8. ) | mysql --user=username --password=password database
  9.  

Heck, I may as well ask as long as I am here.. Is it ok to use php's exec func for the restore or is there a better way?

Thank you,

Frank
Sep 17 '07 #1
1 1494
fjm
348 100+
The word for the day is "Concatenation".

I got it guys... Thanks!
Sep 17 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mark Depenbrock | last post by:
--Apple-Mail-2--68472726 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Can not make mysql connection - error log: 030708 08:53:48 mysqld started
0
by: Morten Gulbrandsen | last post by:
Dear MySQL developers, Could some experienced Database developer please take a look at this ? It is supposed to be plain SQL2. How can it be coded under MySQL Especially all referential...
0
by: Morten Gulbrandsen | last post by:
Hi Programmers, after this legal statement ALTER TABLE EMPLOYEE TYPE =3D InnoDB; I get=20 Warnings: 0 =20 and still MySQL claims to have to use Type =3D MyISAM,
0
by: Maciej Wiznerowicz | last post by:
Dear Sirs, I can not start MySQL server. More specifically, MySQL was running fine all the time since installation. It stopped working after I used FmPro Migrator to convert some File Maker...
3
by: Vanchau Nguyen | last post by:
Hi all, Hoping someone can help us with this strange Innodb problem. At about 5:15 AM 2/2/04 (this morning), our slave server stopped accepting connections. The machine was pingable, but you...
3
by: Andy Tran | last post by:
I built a system using mysql innodb to archive SMS messages but the innodb databases are not keeping up with the number of SMS messages coming in. I'm looking for performance of 200 msgs/sec where...
0
by: niku | last post by:
Hello all. I'm trying to get mysql installed on OpenBSD 3.4. Unfortunately, it appeares that the port only installes the mysql-client, and one needs to install the -server package seperately. This...
5
by: Eddie | last post by:
I have a MySQL-server running Innodb. We have installed ~ 2GB of memory in the server. In spite of this MySQL keeps crashing due to out-of-memory errors. The server is a dual xeon i686 running...
1
by: fuzzybr80 | last post by:
Hi, I am using MySQL version 5.0 on Linux Fedora Core 4. I recently got this error message: 060609 11:06:29 InnoDB: ERROR: the age of the last checkpoint is 9433557, InnoDB: which exceeds...
1
by: Jacob Marble | last post by:
Hello NG- I'm using mysql 5.0.22 as packaged (and updated) with Ubuntu Dapper. I would like to use Innodb, but "show innodb status" says "ERROR 1235 (42000): Cannot call SHOW INNODB STATUS because...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.