Home >Database >Mysql Tutorial >How Can I Clone a MySQL Database Without mysqldump When Server Access is Restricted?
Creating Cloned Database Alternatives without mysqldump
If direct access to the server is unavailable, there are alternatives to using mysqldump for duplicating or cloning MySQL databases.
MySQL Version 4.0 offers the following methods:
CREATE DATABASE new_db_name; INSERT INTO new_db_name.table_name SELECT * FROM current_db_name.table_name;
This method copies both data and structure from the source database to the new one.
mysqldump -h [server] -u [user] -p[password] old_database | mysql -h [server] -u [user] -p[password] new_database
Note that there should be no space between -p and the password.
The above is the detailed content of How Can I Clone a MySQL Database Without mysqldump When Server Access is Restricted?. For more information, please follow other related articles on the PHP Chinese website!