Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 79
Server version: 5.6.20-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use solgle;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+-------------------------+
| Tables_in_solgle |
+-------------------------+
| Message |
| MessageReturns |
| Network |
| NetworkReturns |
| SolgleFeature |
| SolgleIP |
| SolgleTarget |
| SolgleTargetReturns |
| Subdata |
| Sys_log |
| Users |
+-------------------------+
11 rows in set (0.00 sec)
mysql> create table desttable like Users;
Query OK, 0 rows affected (0.13 sec)
mysql> show tables;
+-------------------------+
| Tables_in_solgle |
+-------------------------+
| Message |
| MessageReturns |
| Network |
| NetworkReturns |
| SolgleFeature |
| SolgleIP |
| SolgleTarget |
| SolgleTargetReturns |
| Subdata |
| Sys_log |
| Users |
| desttable |
+-------------------------+
12 rows in set (0.00 sec)
mysql> select * from desttable;
Empty set (0.06 sec)
mysql> insert into desttable select * from Users;
Query OK, 6 rows affected (0.05 sec)
Records: 6 Duplicates: 0 Warnings: 0
mysql> select * from desttable;
+----+-----------+----------+----------------------------------+--------+
| ID | Name | UserName | Password | UserID |
+----+-----------+----------+----------------------------------+--------+
| 1 | zhengsan | admin | 96e79218965eb72c92a549dd5a330112 | 110 |
| 2 | liudun | admin2 | 96e79218965eb72c92a549dd5a330112 | 110 |
| 3 | zhangsan | admin4 | 96e79218965eb72c92a549dd5a330112 | 110 |
| 4 | zhengsan1 | admin | 96e79218965eb72c92a549dd5a330112 | 110 |
| 5 | liudun1 | admin2 | 96e79218965eb72c92a549dd5a330112 | 110 |
| 6 | zhangsan1 | admin4 | 96e79218965eb72c92a549dd5a330112 | 110 |
+----+-----------+----------+----------------------------------+--------+
6 rows in set (0.00 sec)
mysql>
----备份及恢复
[root@solgle-srv ~]# mysqldump -uroot solgle > backup.sql -p
Enter password:
[root@solgle-srv ~]# ls
Desktop Downloads Pictures Templates Videos backup.sql install.log
Documents Music Public Users.txt anaconda-ks.cfg data.sql install.log.syslog
[root@solgle-srv ~]#
---恢复
root@solgle-srv ~]# mysql -uroot solgle < backup.sql -p
Enter password:
[root@solgle-srv ~]#