We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

DB Error: Constraint Violation (After Overwriting Files in Horde)

Medium Priority
480 Views
Last Modified: 2013-12-02
My host suggested I copy and the files that contained my old data from the old directory:
/old/var/lib/mysql/horde/mnemo_memos.MYD
/old/var/lib/mysql/horde/mnemo_memos.MYI
/old/var/lib/mysql/horde/mnemo_memos.frm

To the new files in the new directory:
/var/lib/mysql/horde/mnemo_memos.MYD
/var/lib/mysql/horde/mnemo_memos.MYI
/var/lib/mysql/horde/mnemo_memos.frm

I overwrite these without making a backup and now I need help.

When I overwrote mnemo_memos.MYD I could still add notes via Horde webmail. Then, I overwrote mnemo_memos.MYI and mnemo_memos.frm and I get the following error when I try to add a note in Horde:
There was an error saving the note: DB Error: constraint violation

Can someone please help me just to get this working again. It would be a plus if I could also get my old data saved, too. Thank you.
Comment
Watch Question

President, IT4SOHO, LLC
CERTIFIED EXPERT
Commented:
Hmmmm...

Looks to me like you copied over the MySQL database while the database was active. Try this:

# Turn OFF the MySQL database server
/etc/init.d/mysqld stop
# Copy the old databases again
cp /old/var/lib/mysql/horde/mnemo_memos* /var/lib/mysql/horde/
# Restart the MySQL database server
/etc/init.d/mysqld start

I hope this helps!

Dan
IT4SOHO

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Dude, you're the man! I didn't know I had to shut mysqld off first and the host must not have know either (or they just didn't care to say...). Thanks, man! Now, I've got all my old notes and can add new ones.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.