当前位置:网站首页>MySQL common commands and mysqldump backup
MySQL common commands and mysqldump backup
2022-07-30 07:41:00 【Silent】
I. Character set
1. Create database with default character set
create database if not exists databaseName default charset utf8 collate utf8_general_ci;
2.Character set default configuration
[client]default-character-set=utf8/*[mysqld]*/character-set-server=utf83. View Table Character Set
show create table tableName;4. Modify a single table character set
ALTER TABLE `table` DEFAULT CHARACTER SET utf8;5. Modify the table field record character set (the table has inserted data)
alter table `tablename` convert to character set utf8;6. Create table set character set
create table user(id int not null auto_increment,userName varchar(200) not null,password varchar(200) not null,age int,primary key(id))ENGINE=MyISAM auto_increment=1 default charset=utf8;Second, database connection and backup
1.mysql client cannot connect remotely
GRANT ALL PRIVILEGES ON *.* TO 'user'@'%'IDENTIFIED BY 'password' WITH GRANT OPTION;2. Backup command
Format: mysqldump -h hostname -P port -u username -p password --database database name > filename.sql
mysqldump -h 192.168.1.1 -p 3306 -uroot -ppassword --databases mydb> /data/backup/mydb.sql3. Backup database structure, not data
mysqldump --opt -d database name -u root -p > xxx.sql4. Export data does not export structure
mysqldump -t database name (table name) -uroot -p > xxx.sql5. Export the structure of a specific table
mysqldump -uroot -p -B database name --table table name > xxx.sql6. Import data
#mysql database name < file name#source /tmp/xxx.sql边栏推荐
- 测开基础知识01
- Rapidly develop GraphScope graph analysis applications
- GadgetInspector原理分析
- 牛顿迭代法求方程的根
- Graph analysis like NetworkX with GraphScope
- Unity Shader标准光照模型——高光反射
- Unity Shader的结构与语义
- PC DBCO-PEG3-Biotin|PC-生物素-PEG3-DBCO可用于使用无铜点击化学
- GNNLab:基于空间共享思想设计的新型 GNN 系统
- A New Paradigm for Distributed Deep Learning Programming: Global Tensor
猜你喜欢

掌握JESD204B(三)–AD6676的调试

02-Cycript的使用

SQL并列排序问题

事件传递和响应者链条

About memcache kernel, so one of the most popular

二、1稀疏sparsearray数组

单片机之流水灯

多线程进阶(CountDownLatch,死锁,线程安全集合类)

测试开发工程师成长日记018 - 测试面试必备题记录(持续更新)

The Force Plan Microservices | Centralized Configuration Center Config Asymmetric Encryption and Security Management
随机推荐
GNNLab: A Novel GNN System Based on Spatial Sharing Ideas
instantDrag for Maya脚本 (移动模型时沿目标模型移动)
如何使用xilinx的FFT ip
04-packing and unpacking
图计算101:图计算的类型、语言与系统
测试开发工程师成长日记018 - 测试面试必备题记录(持续更新)
Jenkins一些常见问题
STM32F103连接L9110S电机驱动控制小水泵
替换xxx.jar的class文件命令
Mastering JESD204B (1) – Debugging of AD6676
THREEJS导入外部OBJ+MTL后内存优化
From installation to compilation: 10 minutes to teach you to use and develop GraphScope locally
牛顿迭代法求方程的根
Application of graph computing in network security analysis
Devops基本概念和原理
图扑数字孪生煤矿开采系统,打造采煤“硬实力”
藏不住了,我要揭露云原生的那些不好
NS3 error fatal error: ns3/opengym-module.h: No such file or directory
how to use xilinx's FFT ip
Build an intelligent network security management and control system for digital government