Jump to content


Photo

[Solved] Installation Error

sql error installation staff response

  • Please log in to reply
8 replies to this topic

#1 DynoRulesALL

DynoRulesALL

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 13 October 2016 - 05:11 PM

Hi

 

I'm trying to install version 6.5 and i keep getting this error. Help please.

 

 

  • Error installing module "actions". SQL statement "DROP TABLE IF EXISTS x2_actions;" failed;23000,1217,Cannot delete or update a parent row: a foreign key constraint fails


#2 X2Raymond

X2Raymond

    Advanced Member

  • Administrators
  • 972 posts
  • LocationSanta Cruz, CA

Posted 14 October 2016 - 12:39 PM

Hello,

 

Would you happen to be installing the application using a database which had already been in use? You'll need to drop those remaining tables before rerunning the installation script to satisfy the existing constraints.

 

Raymond



#3 jackdwq

jackdwq

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 17 October 2016 - 07:20 AM

Hello,

 

Would you happen to be installing the application using a database which had already been in use? You'll need to drop those remaining tables before rerunning the installation script to satisfy the existing constraints.

 

Raymond

i have got the same error as Dyno. and i cant get it installed on my server.

 

im useing hostgator. and it keep pop up this when im installing it.

 

Installing X2CRM
  • Completed: set up core database structure
  • Completed: set up role-based access control (RBAC) permissions system
  • Completed: insert time zone data
  • Error installing module "actions". SQL statement "DROP TABLE IF EXISTS x2_actions;" failed;23000,1217,Cannot delete or update a parent row: a foreign key constraint fails


#4 X2Raymond

X2Raymond

    Advanced Member

  • Administrators
  • 972 posts
  • LocationSanta Cruz, CA

Posted 17 October 2016 - 10:01 AM

It sounds like there was already an existing installation using that database, can you confirm if this is the case? Assuming that this database already housed an X2CRM installation, you'll need to remove the existing tables in your database before proceeding with the install to avoid that constraint issue. First, list the existing tables in your database, then remove them. You'll want to use SQL similar to the following:

SHOW TABLES;
DROP TABLE x2_calendars;
DROP TABLE x2_locations;
DROP TABLE x2_actions;

If this database is shared with any other applications for some reason, you'll want to exclude those tables of course. Once the tables are removed, re-run the installation script.



#5 jackdwq

jackdwq

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 18 October 2016 - 03:23 AM

It sounds like there was already an existing installation using that database, can you confirm if this is the case? Assuming that this database already housed an X2CRM installation, you'll need to remove the existing tables in your database before proceeding with the install to avoid that constraint issue. First, list the existing tables in your database, then remove them. You'll want to use SQL similar to the following:

SHOW TABLES;
DROP TABLE x2_calendars;
DROP TABLE x2_locations;
DROP TABLE x2_actions;

If this database is shared with any other applications for some reason, you'll want to exclude those tables of course. Once the tables are removed, re-run the installation script.

should i upload all of the x2crm file  or just the x2crm engine folder



#6 jackdwq

jackdwq

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 18 October 2016 - 07:13 AM

It sounds like there was already an existing installation using that database, can you confirm if this is the case? Assuming that this database already housed an X2CRM installation, you'll need to remove the existing tables in your database before proceeding with the install to avoid that constraint issue. First, list the existing tables in your database, then remove them. You'll want to use SQL similar to the following:

SHOW TABLES;
DROP TABLE x2_calendars;
DROP TABLE x2_locations;
DROP TABLE x2_actions;

If this database is shared with any other applications for some reason, you'll want to exclude those tables of course. Once the tables are removed, re-run the installation script.

 

 

Hello Raymond,

 

Now i have a new error surfaced. see detail following.

 

Installing X2CRM
  • Completed: set up core database structure
  • Completed: set up role-based access control (RBAC) permissions system
  • Completed: insert time zone data
  • Error installing module "users". SQL statement "ALTER TABLE `x2_calendar_permissions` ADD CONSTRAI..." failed;HY000,1005,Can't create table 'jackdwq_jjcrm.#sql-11c29_1b7462d' (errno: 150)

 

i know nothing about sql. please advice me what to do.

 

Regards,

Jack



#7 X2Raymond

X2Raymond

    Advanced Member

  • Administrators
  • 972 posts
  • LocationSanta Cruz, CA

Posted 18 October 2016 - 09:16 AM

Hello Jack,

 

I suspect that issue is arising due to the default storage engine on your host. It is likely that the default engine is MyISAM, and since the x2_users table doesn't include a specific engine statement, it defaults to MyISAM, then fails when attempting to add the foreign key. Since you're on Hostgator, you probably won't be able to modify your MySQL server config, so it may be best to update the installation SQL to include the db engine. First, drop the tables in the half-constructed database to avoid the previous issue. Then, update the file at x2engine/protected/modules/users/data/install.sql, and add the ENGINE statement after the x2_users table definition:

CREATE TABLE x2_users (
    /* ... */
) ENGINE InnoDB, COLLATE = utf8_general_ci;

Then proceed with the installation.

 

Raymond



#8 DynoRulesALL

DynoRulesALL

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 23 January 2017 - 09:24 PM

Thank you Raymond! I got it to install by dropping the tables and updating the install.sql file. BTW I am in HostGator and it gives that error even if the database is brand new. 



#9 wcsr

wcsr

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 14 March 2018 - 07:37 PM

Sorry wrong topic







Also tagged with one or more of these keywords: sql, error, installation, staff response

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users