Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem loading sql into new database
08-10-2015, 04:50 AM
Post: #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`))
Find all posts by this user
Quote this message in a reply
08-10-2015, 05:34 AM
Post: #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
Visit this user's website Find all posts by this user
Quote this message in a reply
08-10-2015, 03:39 PM
Post: #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
Find all posts by this user
Quote this message in a reply
08-12-2015, 01:35 AM
Post: #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
Find all posts by this user
Quote this message in a reply
08-12-2015, 02:03 AM
Post: #5
RE: problem loading sql into new database
Are you being redirected to Dashboard.php? Or is the error before that?
Find all posts by this user
Quote this message in a reply
08-12-2015, 04:00 AM
Post: #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?
Find all posts by this user
Quote this message in a reply
08-12-2015, 04:19 AM
Post: #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?
Find all posts by this user
Quote this message in a reply
08-12-2015, 05:43 AM
Post: #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.
Find all posts by this user
Quote this message in a reply
08-12-2015, 06:14 AM
Post: #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.
Find all posts by this user
Quote this message in a reply
08-12-2015, 03:01 PM
Post: #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
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)