CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Joomla! Installations (Moderator: Deepak Srivastava) »
  • Database Error out of the blue
Pages: [1]

Author Topic: Database Error out of the blue  (Read 3767 times)

smdstudios

  • Guest
Database Error out of the blue
September 24, 2007, 07:51:26 am
I am getting the following error and need some help on how to get this fixed. Were are the SQL files so that I could maybe reinstall it??

Database Error Code: Table 'afm389_joomla.civicrm_domain' doesn't exist, 1146

Error Details:

[db_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT * FROM civicrm_domain WHERE ( civicrm_domain.id = 1 ) [nativecode=1146 ** Table 'afm389_joomla.civicrm_domain' doesn't exist]"]

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Database Error out of the blue
September 24, 2007, 09:59:21 am
Is your Joomla site running properly? I ask this because the typical (default) configuration for CiviCRM in Joomla is to have both applications use the same database (which apparently is afm389_joomla in your case).

Do you have a recent backup of the database? Does the CiviCRM install contain live data which you need - or is it a test install?
Any clues on what may have changed since things were working?
'
You can certainly "re-create" the CiviCRM tables and configuration data - but any data that you've imported or entered would be lost if you don't have a backup.
Protect your investment in CiviCRM by  becoming a Member!

smdstudios

  • Guest
Re: Database Error out of the blue
September 24, 2007, 10:22:52 am
The Joomla Site is running fine and it appears people can still sign in and use the site.

When I try to restore a backup DB I get an error "duplicate foreign key". I really can afford to start over if at all possible because this is a live site.


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Database Error out of the blue
September 24, 2007, 11:07:31 am
Quote from: smdstudios on September 24, 2007, 10:22:52 am
When I try to restore a backup DB I get an error "duplicate foreign key". I really can afford to start over if at all possible because this is a live site.

At this point, I think you may need to engage some professional technical assistance to dig into this. There are too many open questions - most critically understanding why your CiviCRM tables would have disappeared. I'm not sure it makes sense to either try to restore OR start over until this is clarified.
Protect your investment in CiviCRM by  becoming a Member!

smdstudios

  • Guest
Re: Database Error out of the blue
September 25, 2007, 05:17:58 am
Starting over isn't really an option. What is that table anyways? Can I locate the SQL script and simple recreate the table??

speleo

  • Ask me questions
  • ****
  • Posts: 396
  • Karma: 28
  • CiviCRM version: 4.3.1
  • CMS version: J! 2.5,9
  • MySQL version: 5.1
  • PHP version: 5.3.24
Re: Database Error out of the blue
September 25, 2007, 07:33:36 am
Is that the only table that you've lost? If you can reinstall on a dev system then you can try copying the table across to your live site. Unless you have multiple domains then it is only going to have a single record.

However it may well be that you've got other issues. There was a conversation way back (pre forum) which talked about a method to export and then import data between version upgrades. Might be worth searching through Nabble or the wiki to see if you can find anything.

mcsmom

  • I post frequently
  • ***
  • Posts: 266
  • Karma: 23
    • Official Joomla! Book
  • CiviCRM version: 4 and 3.4
  • CMS version: Joomla!
Re: Database Error out of the blue
September 30, 2007, 03:02:58 pm
YOu can unenable the foreign keys. CiviCRM uses them a lot and usually I end up doing that when importing and exporting.

smdstudios

  • Guest
Re: Database Error out of the blue
October 01, 2007, 01:53:42 pm
Well I have realized all the civicrm tables were wiped out. No clue how that happened????

Anyhow I got a copy of the DB to reimport and get the following error...


Code: [Select]
SQL query:

CREATE TABLE `civicrm_acl` (
`id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT ,
`domain_id` int( 10 ) unsigned NOT NULL default '0',
`name` varchar( 64 ) default NULL ,
`deny` tinyint( 4 ) NOT NULL default '0',
`entity_table` varchar( 64 ) NOT NULL default '',
`entity_id` int( 10 ) unsigned default NULL ,
`operation` enum( 'All', 'View', 'Edit', 'Create', 'Delete', 'Grant', 'Revoke' ) NOT NULL default 'All',
`object_table` varchar( 64 ) default NULL ,
`object_id` int( 10 ) unsigned default NULL ,
`acl_table` varchar( 64 ) default NULL ,
`acl_id` int( 10 ) unsigned default NULL ,
`is_active` tinyint( 4 ) default NULL ,
PRIMARY KEY ( `id` ) ,
KEY `index_acl_id` ( `acl_id` ) ,
KEY `FKEY_domain_id` ( `domain_id` ) ,
CONSTRAINT `civicrm_acl_ibfk_1` FOREIGN KEY ( `domain_id` ) REFERENCES `civicrm_domain` ( `id` )
) TYPE = InnoDB

MySQL said: Documentation
#1005 - Can't create table './afm389_joomla/civicrm_acl.frm' (errno: 121)

speleo

  • Ask me questions
  • ****
  • Posts: 396
  • Karma: 28
  • CiviCRM version: 4.3.1
  • CMS version: J! 2.5,9
  • MySQL version: 5.1
  • PHP version: 5.3.24
Re: Database Error out of the blue
October 01, 2007, 02:38:59 pm
Your best bet is to google "#1005 - Can't create table  (errno: 121)"

Searching turns up this http://forums.mysql.com/read.php?22,33999,76181#msg-76181

"errno 121 means a duplicate key error. Probably the table already exists in the InnoDB internal data dictionary, though the .frm file for the table has been deleted. This is the most common reason for getting errno 121 in table creation. Another possible reason is a name conflict in a foreign key constraint name. Constraint names must be unique in a database, like table names are."

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Database Error out of the blue
October 10, 2007, 05:59:59 am
What are you using to reimport the data? Phpmyadmin? MySQL gui tools? Command line? Some of the import/export tools don't work with each other, and will have issues trying to create the tables/import data. Inability to create a table may also be a permissioning problem.

I had a similar issue where I needed to recreate a site and reinstall my CiviCRM data. I ended up reinstalling CiviCRM from scratch in Joomla, so that the installer recreated my table structure. Then I reimported the data from sql--less the table create definitions (because they were giving me problems). You might need to manually edit the sql file though, in order to remove those table create lines.

-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Joomla! Installations (Moderator: Deepak Srivastava) »
  • Database Error out of the blue

This forum was archived on 2017-11-26.