MySQL

We are building a web app. Because of it's complexity, it is necessary to have a test environment in which to test changes.

I have set up a database on the test server (same as live).

From time to time I would like to truncate ALL tables I reload with SQL from a backup of the live database. There may be both structure & data changes.

Is there a way I can do that with phpmyadmin? Like truncate ALL or something like that?

Thanks
Richard KortsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arnoldCommented:
Are you asking whether phpmyadmin has the option to backup/export the database without the data?
I.e. Structure only.
0
Dave BaldwinFixer of ProblemsCommented:
Truncate isn't what you want because it keeps the current structure.  If you dump your 'live' database tables with ...
DROP TABLE IF EXISTS `thistable`;
CREATE TABLE IF NOT EXISTS `thistable` (

Open in new window

Then the 'dumped' version will be recreated on the test server when you import it.  I do this all the time with phpMyAdmin using the Export / Import tabs.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Richard KortsAuthor Commented:
Perfect; I never knew what those options were before.

Thanks
0
arnoldCommented:
To do the drop as indicated, you have to have a backup without the data which often includes the check.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.