Hi all, I am fairly new at drupal but have another site running well, without civicrm. I followed their instructions fairly well from http://wiki.civicrm.org/confluence/pages/viewpage.action?pageId=3989 but am getting this issue after enabling the module.
"Home
Drupal
warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server during query in /home/.gerald/petsbella/dev.petsbella.com/modules/civicrm/packages/DB/mysql.php on line 237.
unrecoverable error
Sorry. A non-recoverable error has occurred.
Return to CiviCRM menu.
error
Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)
[code] => -24
[message] => DB Error: connect failed
[mode] => 16
[debug_info] => [nativecode=Lost connection to MySQL server during query]
[type] => DB_Error
[user_info] => [nativecode=Lost connection to MySQL server during query]
[to_string] => [db_error: message="DB Error: connect failed" code=-24 mode=callback callback=CRM_Core_Error::handle prefix="" info=" [nativecode=Lost connection to MySQL server during query]"]
)"
I also get errors when importing civicrm_generated.mysql after building the dev db and importing civicrm_41.mysql.
"SQL query:
INSERT INTO `civicrm_accept_credit_card`
VALUES ( 1, 1, 'Visa', 'Visa', 0, 1 ) , ( 2, 1, 'MasterCard', 'MasterCard', 0, 1 ) , ( 3, 1, 'Amex', 'American Express', 0, 1 ) , ( 4, 1, 'Discover', 'Discover', 0, 1 ) ;
MySQL said: Documentation
#1452 - Cannot add or update a child row: a foreign key constraint fails (`devcivicrm/civicrm_accept_credit_card`, CONSTRAINT `civicrm_accept_credit_card_ibfk_1` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`)) "
Here are my server stats
php - 5.1.2
MySQL client version: 5.0.16
MySQL - 5.0.18-standard-log
Let me know if you need anything else
I am probably doing something wrong because I created a dev site to build drupal from scratch with seperate dev drupal and civicrm db's. Any and all help would be appreciated.
Michael Yannotti
Comments
Comment #1
yannotmi commentedI created the dev site to see if I can replicate the problem, which I did...
Comment #2
yannotmi commentedMe and my buddy found that the civicrm_domain table was empty. I inserted an row into the table and am now getting more errors loading the generated.mysql file.
MySQL said: Documentation
#1452 - Cannot add or update a child row: a foreign key constraint fails (`devcivicrm/civicrm_address`, CONSTRAINT `civicrm_address_ibfk_1` FOREIGN KEY (`location_id`) REFERENCES `civicrm_location` (`id`))
snippet
INSERT INTO `civicrm_address`
VALUES ( 1, 1, 'NE 442G Caulder Pl SW', 442, 'G', 'NE', 'Caulder', 'Pl', 'SW', NULL , 'Community Relations', NULL , NULL , 'Tampa', 1, 1008, '33625', NULL , NULL , 1228, 1, 28.0698 , - 82.5573, NULL , NULL )
Comment #3
Torenware commentedMichael,
This is a pure CiviCRM issue. I'm guessing that for some reason, your initial upload of the CiviCRM tables was interupted, and you're trying to install civicrm_generated.sql more than once. That won't work. You'll need to completely remove all tables starting with "civicrm_" from your database, and then start your install again from scratch.
I'd also recommend that you post this kind of problem to the CiviCRM mail list (go to http://www.civicrm.org to find out how to do that; they just changed their list serve), since that's the most likely place to get help with this sort of thing.
The easiest way to get CiviCRM 1.4 right now is via the CivicSpace install, which I am aware is for a 4.6 distribution of Drupal. Depending upon your resources and need for speed, you may find the fastest way to get up and running under Drupal 4.7 is to pay somebody for about 2 hours of work to just do the basic CiviCRM install and configuration, especially if you're not all that comfortable with doing MySQL 4.x and 5.x installs yourself.
My sense is that either this is the underlying issue, or there is something truly unusual about your MySQL set up, since the install is usually very simple and clean for a standard set up.
Cheers,
Rob
Torenware Networks
Comment #4
pathscollide commentedJust to add one hopefully useful bit of info. I had the exact same errors as yannotmi, and I went through the arduous process of reinstalling everything a couple of times. Then I realized I had made a simple, silly error: in the civicrm.settings.php file, you have to define the database connection twice for some reason. The second time, I had indicated an incorrect domain name (the name of my main domain, and not the address of the mysql server). I fixed that and everything seems to be working fine.
Comment #5
yannotmi commentedI tried deleting the DB and reinstalling without any errors this time. There must be issues with my config file because it still will not work.
Comment #6
jasonwhat commentedI couldn't disagree with this statement more,
The installation instructions are not user-friendly at all. As installs go, drupal is about medium hard, this is very hard. The install instructions do a lot of assuming command line access which many people don't have and many don't know how to use. The configuration files are not at all intuitive. For example, there are certain config options that will be the same in every drupal install of CiviCRM, like the location of the templates, yet this has to be set manually. When CiviCRM gets to a point that you just have to set the info for the database name and password I'll agree that it is "simple." For now, it is unecessarily confusing to say the least.
I'm having the same problems installing the tables by the the way. I keep getting this sql error:
"#1216 - Cannot add or update a child row: a foreign key constraint fails "
I'm totally at a loss with this and can't belive it is this hard to install the database tables.