[转帖]Mysql 常用命令行,持续补充

mysql,常用,命令行,持续,补充 · 浏览次数 : 0

小编点评

## 常用命令行工具 以下是两种使用命令行工具进行数据库操作的方法: **1. 查看所有数据库** ```sql show databases; ``` **2. 选择数据库** ```sql use fids; ``` **3. 查看当前数据库所有表** ```sql show tables; ``` **4. 查看所有存储过程** ```sql show procedure status; ``` **5. 查找存储过程名为`flight_move_his`的存储过程** ```sql select * from procedure status where name = 'flight_move_his'; ``` **6. 查看所有事件** ```sql show events; ``` **7. 导入数据库** ```sql mysql -h127.0.0.1 -uroot -p -P3306 --default-character-set=utf8 --databases 单个或多个数据库名称空格分开 | mysql -h127.0.0.1 -uroot -p -P3306# ``` **8. 导出数据库** ```sql mysql -h127.0.0.1 -uroot -p -P3306 --default-character-set=utf8 --all-databases | mysql -h127.0.0.1 -uroot -p -P3306# ```

正文

https://www.cnblogs.com/wzj1223/p/13152446.html

 

1.常用命令行

# 登录Mysql
mysql -uroot -proot
# 查看所有数据库
show databases; 
# 选择数据库
use fids;
# 查看当前数据库所有表;
show tables;
# 查看所有存储过程
show procedure status; 
# 查找存储过程名为flight_move_his;
show procedure status where name ='flight_move_his'; 
# 查看所有事件;
show events;

2.Mysql数据迁移,从一个服务器到另一个服务器

# 需要两个服务器数据库版本相同才可迁移
# 1:单个或多个数据库
mysqldump -h远程ip -u用户 -p密码 -P3306 --default-character-set=utf8  --databases 单个或多个数据库名称空格分开 | mysql -h127.0.0.1 -uroot -p -P3306

# 执行后输入本地数据库密码即可

# 2:所有数据库
mysqldump -h远程ip -u用户 -p密码 -P3306 --default-character-set=utf8 --all-databases | mysql -h127.0.0.1 -uroot -p -P3306

# 3:某库某表
mysqldump -h远程ip -u用户 -p密码 -P3306 --default-character-set=utf8  dbname table1 table2…… | mysql -h127.0.0.1 -uroot -p -P3306

与[转帖]Mysql 常用命令行,持续补充 相似的内容:

[转帖]Mysql 常用命令行,持续补充

https://www.cnblogs.com/wzj1223/p/13152446.html 1.常用命令行 # 登录Mysql mysql -uroot -proot # 查看所有数据库 show databases; # 选择数据库 use fids; # 查看当前数据库所有表; show t

[转帖]MySQL pid 和 socket 文件说明

2021-10-13 11:595110转载MySQL 1 pid-file文件 MySQL 中的 pid 文件记录的是当前 mysqld 进程的 pid ,pid 亦即 Process ID 。可以通过 pid-file 参数来配置 pid 文件路径及文件名,如果未指定此变量,则 pid 文件默认

[转帖]MySQL 慢查询日志深入理解

https://www.jb51.net/article/210312.htm + 目录 什么是慢查询日志 MySQL的慢查询日志是 MySQL提供的一种日志记录,它用来记录在 MySQL 中响应时间超过阀值的语句,具体指运行时间超过long_query_time 值的 SQL,则会被记录到慢查询日

[转帖]MySQL with Docker - Performance characteristics

https://dev.mysql.com/blog-archive/mysql-with-docker-performance-characteristics/ Docker presents new levels of portability and ease of use when it co

[转帖]MySQL Performance : Impact of InnoDB Transaction Isolation Modes in MySQL 5.7

http://dimitrik.free.fr/blog/archives/2015/02/mysql-performance-impact-of-innodb-transaction-isolation-modes-in-mysql-57.html There were so many valua

[转帖]MySQL Performance : IP port -vs- UNIX socket impact in 8.0 GA

http://dimitrik.free.fr/blog/posts/mysql-performance-80-ga-ip-port-vs-unix-socket-impact.html 2018-06-15 16:05 | MySQL, Performance, InnoDB, Benchmark

[转帖]MySQL Performance : XFS -vs- EXT4 Story

http://dimitrik.free.fr/blog/posts/mysql-80-perf-xfs-vs-ext4.html 2020-05-13 22:15 | MySQL, Performance, InnoDB, Benchmarks, DoubleWrite, XFS, EXT4 by

[转帖]MySQL Performance : 8.0 and UTF8 impact

http://dimitrik.free.fr/blog/posts/mysql-performance-80-and-utf8-impact.html 2018-04-26 00:58 | MySQL, Performance, UTF8 by Dimitri The world is movin

[转帖]MySQL十六:36张图理解Buffer Pool

https://www.cnblogs.com/yunlongn/p/16630257.html 转载~ 在应用系统中,我们为加速数据访问,会把高频的数据放在「缓存」(Redis、MongoDB)里,减轻数据库的压力。 在操作系统中,为了减少磁盘IO,引入了「缓冲池」(buffer pool)机制。

[转帖]MySQL提升笔记(4)InnoDB存储结构

https://cdn.modb.pro/u/310923 这一节本来计划开始索引的学习,但是在InnoDB存储引擎的索引里,存在一些数据存储结构的概念,这一节先了解一下InnodDB的逻辑存储结构,为索引的学习打好基础。 从InnoDB存储引擎的存储结构看,所有数据都被逻辑地放在一个空间中,称之为