MySQL Workbench
n^AQ!wC 一个图形化管理工具,功能类似SQL Server Management Studio (SSMS)
@dzO{) http://dev.mysql.com/downloads/tools/workbench/ `'{>2d%\g #JH#Qg MySQL 命令大全
@sAT#[j http://see.xidian.edu.cn/cpp/u/mysql_ml/ #;32(II HNRZ59Yyq 1. CMD - MySQL Backup
#q"^6C
5 "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqldump.exe" -u root -p123abc test > D:\Backup\MySQL\test_20140521.sql
Ck|3DiRQ p<2A4="& 可以通过计划任务来调用MySQL_Backup.bat批处理来实现每天自动备份;
\lnps f @ECHO OFF
%C!u/:.Kv set y=�te:~0,4%
ix<sorR H set m=�te:~5,2%
JwNG`MGc set d=�te:~8,2%
8 ]N "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqldump.exe" -u root -p123abc test > D:\Backup\MySQL\test_%y%%m%%d%.sql
~@x@uY$5 2. CMD - MySQL Restore
J1^6p*]GX 恢复的过程,先创建一个数据库,然后进入这个数据库,使用Source来恢复数据库。
SEn-8ZF mysql.exe -u root -p
`,mE
'3& show databases;
c5?;^a[ create database test001;
sglYT!O use test001;
+)C?v&N source D:\Backup\MySQL\test_20140521.sql ;
`zNvZm -E uFM]4v3 3. Example
@;iW)a_M ### 备份
N@$g"w C:\Users\Administrator>"C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqldump.exe" -u root -p1234-qwer test > D:\Backup\MySQL\test_20140521.sql
(Yz EsY Warning: Using a password on the command line interface can be insecure.
c7mIwMhl~ ### 恢复
Fi+v:L| C:\Program Files\MySQL\MySQL Server 5.6\bin>mysql.exe -u root -p
7]t$t3I` Enter password: *********
};[~>Mzl Welcome to the MySQL monitor. Commands end with ; or \g.
cD&53FPXC Your MySQL connection id is 60
eHCLENLmB Server version: 5.6.10 MySQL Community Server (GPL)
{AbQaw Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
:- B,Q3d Oracle is a registered trademark of Oracle Corporation and/or its
]iewukB4 affiliates. Other names may be trademarks of their respective
'!*,JG5_ owners.
xc.(-g[ Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
(9r\YNK mysql> show databases;
R}MdBE +--------------------+
0|g|k7c{rF | Database |
"'us.t. +--------------------+
ig(a28% | information_schema |
"
N)dle, | mysql |
}eUeADbC | performance_schema |
)N`a4p | sakila |
lub(chCE[ | test |
OfC0lb:c | world |
W]kh?+SZ +--------------------+
R7: >'*F 7 rows in set (0.00 sec)
&WN#HI."] mysql> create database test001;
0j*-ZvE)30 Query OK, 1 row affected (0.00 sec)
{2<A\nW mysql> show databases;
f`w$KVZ1!w +--------------------+
b0
))->&2 | Database |
2 2K:[K +--------------------+
x
;V7D5 q | information_schema |
Ipo?>To | mysql |
jQjtO"\JG | performance_schema |
EU?)AxH^ | sakila |
!yAg!V
KY | test |
/Po't(-x | test001 |
ld58R | world |
t}LV[bj1u +--------------------+
S;DqM;Q 8 rows in set (0.00 sec)
[4uTp[U!r mysql> use test001
k(|D0%#b7 Database changed
k.nq, mysql> source D:\Backup\MySQL\test_20140521.sql
E!.>*`)?. Query OK, 1 row affected (0.00 sec)
"N'tmzifh mysql> exit
H^ _[IkuA% Bye
&Rw4ub3