Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem loading sql into new database
08-10-2015, 04:50 AM,
#1
problem loading sql into new database
when loading old sql (MySQL 5.?) into a new one (Bitnami stack 5.5), I get the following sql error:

any idea what this means?

any help is appreciated,

Klaus

SQL query:


--
-- Constraints for table `chartdetails`
--
ALTER TABLE `chartdetails`
ADD CONSTRAINT `chartdetails_ibfk_1` FOREIGN KEY (`accountcode`) REFERENCES `chartmaster` (`accountcode`),
ADD CONSTRAINT `chartdetails_ibfk_2` FOREIGN KEY (`period`) REFERENCES `periods` (`periodno`);



MySQL said: Documentation
#1452 - Cannot add or update a child row: a foreign key constraint fails (`we_150809`.`#sql-acc_36`, CONSTRAINT `chartdetails_ibfk_2` FOREIGN KEY (`period`) REFERENCES `periods` (`periodno`))
Reply
08-10-2015, 05:34 AM,
#2
RE: problem loading sql into new database
Hi Klaus, foreign key checks should be set off, so

SET foreign_key_checks = 0;

should appear at the beginning of the file, can you check this is there?

Tim
Reply
08-10-2015, 03:39 PM,
#3
RE: problem loading sql into new database
(08-10-2015, 05:34 AM)falkoner Wrote: Hi Klaus, foreign key checks should be set off, so

SET foreign_key_checks = 0;

should appear at the beginning of the file, can you check this is there?

Tim

thanks Tim, I do not have that and will try whether it solves the import problem.

Klaus

Reply
08-12-2015, 01:35 AM,
#4
RE: problem loading sql into new database
Hi Tim, got that working by using MySQL workbench instead of phpmyadmin. With the latter, I also had utf8 problems on another oSS project.

I copied all code to new webserver, and imported the database.
Now, I can choose company and 'log in', but am directed to a white page:
The website cannot display the page, http 500.

Do you have any idea what is wrong? Do I need to change path to company directory somewhere?

Thanks,

Klaus
Reply
08-12-2015, 02:03 AM,
#5
RE: problem loading sql into new database
Are you being redirected to Dashboard.php? Or is the error before that?
Reply
08-12-2015, 04:00 AM,
#6
RE: problem loading sql into new database
(08-12-2015, 02:03 AM)agaluski Wrote: Are you being redirected to Dashboard.php? Or is the error before that?

just a White page with thetext I mentioned. No indication where that Comes from.
Is the path of companies Directory hardcoded somewhere, or in the db?

Reply
08-12-2015, 04:19 AM,
#7
RE: problem loading sql into new database
I think you can tell which page is giving you the error by looking in the URL of the browser
Do you have access to the web server log files?
Have you checked the config.php file to ensure correct Database name, user and password?

Reply
08-12-2015, 05:43 AM,
#8
RE: problem loading sql into new database
thanks.

yes, db etc should be ok - works on the other websoftware which I transfered.
it dies on http://opw2/weneu/index.php - so no clear indication what goes wrong.
Reply
08-12-2015, 06:14 AM,
#9
RE: problem loading sql into new database
Do you have access to the web server log files? I am guessing the logs would give the error message.
Reply
08-12-2015, 03:01 PM,
#10
RE: problem loading sql into new database
dear all

I have problem with database sample, some module weberp can't use below. I hope get resolve from you're. thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)