Click Technology

Linux, Windows, Mac it's all good

Copy or backup MySQL tables

September23

This is a very simple and very effective procedure. Log on to your server and then log on to your database with the usual command..

mysql -u root -p

and enter your password.

Select your database using the command

USE your_database_name;

Then, use the following commands..

To copy the table and the data…

CREATE TABLE your_table_backup SELECT * FROM your_table;

To copy the table structure only, no data, use…

CREATE TABLE your_table_backup SELECT * FROM your_table LIMIT 0;

Nice.

posted under Linux Tips

Email will not be published

Website example

Your Comment:

This is my website for short blog posts and interesting materials that are noteworthy or have some handy-tip value.