mysql导入、导出、查看binlog命令
-- mysql 导出
mysqldump -h 172.xx.xx.xx -u [username] -p [database]> db.sql
-- mysql 导入
msql -u[username] -p
source d:/db.sql
--创建数据库
CREATE DATABASE IF NOT EXISTS ifaes default charset utf8 COLLATE utf8_general_ci;
-- 授权
grant select,delete,update,insert on ifaes.* to dev@'%' identified by 'dev';
grant all privileges on *.* to shuzzcuser@'localhost';
GRANT INSERT,DELETE,UPDATE,SELECT ON fcex.* TO 'fcex'@'localhost';
flush privileges;
-- 查看binlog
cd /usr/local/mysql/bin
/mysqlbinlog -v --start-datetime='yyyy-MM-dd HH:mm:ss' --stop-datetime='yyyy-MM-dd HH:mm:ss' /data/mysql/logs/mysql-bin.000004 >/tmp/tmp.sql
-- 拷贝文件到远程服务器
scp -P port web.zip root@172.xx.xx.xx:/data/www
拷贝覆盖
\cp -rf /source /target
上一篇: 关于 angularJS的一些用法