Skip to content

aisuhua/mysql-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MySQL

CheetSheet

DB

CREATE DATABASE dbname CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

User

CREATE USER 'username'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON `dbname`.* TO 'username'@'%';

Backup and Restore

# 全备
mydumper -h 127.0.0.1 -u root -p password -o mysql-$(date +%Y%m%dT%H%M%S)

# 从全备中恢复指定库
myloader -h 127.0.0.1 -u root -p password -d mysql-20230426T155441 -s test --overwrite-tables

# 恢复全部数据
myloader -h 127.0.0.1 -u root -p password -d mysql-20230426T155441 --overwrite-tables

# 不支持恢复单表,可手工恢复
source test.demo-schema.sql
source test.demo.sql

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages