answersLogoWhite

0


Best Answer

I'm assuming you mean *duplicate* not replicate. Replicating refers to having the same data on multiple machines for either performance or backup issues. The following solution is for duplicating a table. I'm by no means a MySQL genius, but I've worked with MySQL for a while. If you have PHPMyAdmin installed, the easiest thing to do is go to your table, click Operations, fill in "copy table to..." If you don't have PHPMyAdmin, the easiest way I can think of is using mysqldump, editting the dump file, then importing the table: > mysqldump -p DatabaseNameToGetFrom TableName > SomeFileName.dump > pico/ee/edit/vi/emacs/YourFavoritePlainTextEditor SomeFileName.dump Use a find and replace on the old table name and change it to the new tablename, save it, exit the editor then run this command: > mysql -p -D DataBaseNameToPutInto < SomeFileName.dump That should do it fine. Another way is this command:

create table NEW select * from OLD; Then use:

show create table OLD;

alter table NEW add primary key (this,that);

Then add other keys as necessary;

User Avatar

Wiki User

16y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you replicate a MySQL TABLE?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is MyISAM in MySQL?

MyISAM is the default table engine in the MySQL database.


How do you store and retrieve pictures in MySQL database?

The best thing to do is store them in a longblob field in your MySQL table.


What is MySQL insert command?

The INSERT command in MySQL allows you to enter a new row of data to a table in your database.


How do you create a table in dreamweaver?

using the mysql command "create table table_name" we can create a table in dreamweaver.


How do you retrieve 10 records from table in mysql?

For work with mysql database make use of software below to open/read/scan/export-import mysql data


How can you create a MYSQL table?

A good place to find tutorials on how to make a MYSQL table is tutorials point. It will show how to create the table as well as give many examples. It also has many other related tutorials.


How do you retrieve data from one MySQL table and create another MySQL table with the same data in it using PHP?

Execute a SELECT INTO statement on the mysql database: INSERT INTO destination_table (id, first_name, last_name) SELECT id, first_name, last_name from source_table;


What is the role of the insert command in MySQL?

The INSERT statement in MySQL is used to add data to a table. The INSERT INTO command inserts one or more rows into a MySQL table. For single row insertion you need to use the following syntax: INSERT Into table_name(column_1,column_2,column_3) VALUES(value_1, value_2, value_3); To speed up the process, you can use additional MySQL database management tools. For example, in dbForge Studio for MySQL, you can use the Generate Script as feature to insert one or more rows into a MySQL table.


What command is used to remove a table in MySQL?

Please refer to the related links section which points to the correct page of the on-line MYSQL manual.


How can i Have php post to self with mysql?

Mysql is an Database where Data from HTML forms will be inserted to it by some scripts like ASP 3 (classic), ASP.NET, PHP, ColdFusion and... What you need is a form (By HTML), an Database and table in Mysql and PHP to insert data from your form to the table. mysql insert command is: INSERT INTO table_name_here (column1, column2, ..) VALUES (value_of_column_1, value_of_column_2, ...)


How do you set up a hit counter?

Using either CGI or PHP and a MYSQL table.


Can you join a table to itself?

Yes. In MySQL you can join a table to itself. You must use different alias name for each instance.