Jump to content

My database is making me stand on my head too !


Go to solution Solved by Jacques1,

Recommended Posts

Hi all !

 

My windows crashed  :-\ and I imported my database into the new installation of xampp on my new HD. All the primary keys and auto-increments were lost and for 2 days i nearly pulled my hair out,  before I figured out why my application was behaving so strangely  :suicide:

 

The database on my previous HD is intact and I need to import it so that all prmary keys and other relational integrity is a maintained after the import. What should I do ?

 

With so many tables in the database, it would be a huge task if I have to do this manually for each table. Please help !!!!!!!!!!  :cry:  

 

( why is php freaks logo and title doing a Guru Jacques !?! )

 

Thanks all.

Hi Guru Jacques !!  :happy-03:

 

Thanks for the reply !

 

Forgive me if I am wrong, but isn't the export command in phpmyadmin the same as mysqldump? I used the export command to get my dump. I used the quick export method with the SQL format chosen. 

 

It resulted in all tables losing primary keys and thereby the ability to Auto increment. It may have also broken the referential integrity between tables. I haven;t checked that yet. 

 

If I still need to use mysqldump, then with what options, if any ?

 

Please elaborate a bit, 

 

Thanks loads  !

Edited by ajoo
  • Solution

Whatever phpmyadmin is doing, it's obviously not doing the right thing. So forget about it for now and use the standard backup tool.

 

mysqldump creates a full backup, including all keys, counters and whatnot. You generally don't have to set any special options (only --routines if you have stored procedures).

  • Like 1

If you look at the script that phpmyadmin has created, does it contain the commands to add the constraints back in (They should be near the bottom )

Something along the lines of...

--
-- Constraints for dumped tables
--

--
-- Constraints for table `ActivityIn`
--
ALTER TABLE `ActivityIn`
  ADD CONSTRAINT ...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.