Practice
Earlier I talked about how to move tables between databases .

Now let's look at how to copy a table: either just its structure, or its structure together with the data
It's easy too:
This script copies the mytable table from database database1 to database database2. After the structure is copied (the first line), the data is copied (the second line).
As you might guess, if you don't need to copy the data, then you simply don't run the second line.
The same method can be used to copy tables within a single database.
PS. All of this is done in the MySQL administration console. That is, we go into the console:
where instead of username you substitute the database user name (for example, root, which has maximum privileges and has existed since the DBMS was born). If we're talking about Windows, then run the corresponding utility from the "Start" menu.
MySQL 5.x+,
Comments