MYSQL运维常用命令

时间:2021-01-16 21:53:08

1、创建数据库:
    GBK: create database test2 DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci;  
    UTF8: CREATE DATABASE `test2` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
2、备份数据库:
    mysqldump-h127.0.0.1-uroot-ppass myweb> d:/backupfile.sql
3、导入数据库
    source d:/backupfile.sql