新建一个iot_telecom

mysql> create database iot_telecom;
Query OK, 1 row affected (0.08 sec)
把iot的所有东西,复制到iot_telecom中,注意密码是ass,-p后面紧接着密码,变为了-pass。

mysqldump iot -uroot -pass --add-drop-table | mysql iot_telecom -u root -pass

[root@slave02 ~]# mysqldump iot -uroot -pass --add-drop-table | mysql iot_telecom -u root -pass
mysql: [Warning] Using a password on the command line interface can be insecure.
mysqldump: [Warning] Using a password on the command line interface can be insecure.

如果2个mysql不是同一台服务器,可用 -h 参数

mysqldump iot -uroot -pass --add-drop-table | mysql -h 192.168.5.115 iot_telecom -u root -pass

Logo

更多推荐