假如源数据库名称为“srcdb”,目标数据库名称为trgdb 首先创建目标数据库: create database trgdb; 查看源数据库中的所有表名: use information_schema; select table_name from TABLES where TABLE_SCHEMA= ‘srcdb’; 针对上面查询出来的表名,依次执行
假如源数据库名称为“srcdb”,目标数据库名称为"trgdb"
首先创建目标数据库:
create database trgdb;
查看源数据库中的所有表名:
use information_schema;
select table_name from TABLES where TABLE_SCHEMA= ‘srcdb’;
针对上面查询出来的表名,依次执行以下命令:
rename table srcdb.tablename1 to trgdb.tablename1;
这样源数据库srcdb中的表(表结构和表数据)就被全部迁移到目标数据库trgdb了。
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号