Jump to content

My database is making me stand on my head too !


ajoo

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.

Link to comment
Share on other sites

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  !

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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 ...
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.