当前位置:网站首页> CentOS7环境下MySQL8常用命令小结
CentOS7环境下MySQL8常用命令小结
2022-06-10 20:28:00 【1024问】
前言
一、常用语句
1、登录&退出
2、常用操作
附:常用语句
总结
前言CentOS7 安装MySQL8详细步骤
MySQL查看表占用空间大小
MySQL: 范围查询优化
CentOS7 + MySQL8
一、常用语句1、登录&退出# 连接本服务器数据库mysql -u root -p#退出exit/*-----------------------------------------*/# 其他服务器连接数据库# 连接数据库介绍。指令是 mysql,常用选项如下:# -h:主机host# -P:端口prot# -u:用户名user# -p:用户密码123456mysql -h172.22.1.143 -u root -P 6399 -p1234562、常用操作#查看有哪些数据库show databases; #创建一个数据库create database video_db;#选择使用video_db数据库use video_db;#查看数据库中的表 show tables;#查看当前选择的数据库select database();#查看video_info表全部字段信息desc video_info;附:常用语句//启动的时候没有报错就是启动成功的,即使“Redirecting to /bin/systemctl start mysql.service”//具体情况可使用状态查询指令查询其状态。service mysqld start #使用service启动mysql服务service mysqld status #查看MYSQL运行状态service mysqld stop #使用service停止mysql服务service mysqld restart #使用service重启mysql服务//查询mysql版本(1)终端执行 mysql -V (2)mysql里面查看 select version();//连接数据库mysql -u root -p #以管理员身份登录我云服务上的pscode是(tantan_esc同):zS+qq。quit #退出mysql/*-----------------------------------------*/连接数据库介绍。指令是 mysql,常用选项如下:-h:主机host-P:端口prot-u:用户名user-p:用户密码passcode-A:不预读数据库信息(数据库中表比较多的时候预读数据库信息会很慢以至于卡住)表名:末尾可以加上库名。这样就相当于直接进入该数据库,等价于执行一次 use 库名;举例:举例如下,注意最后一个-p不要带空格。。。。!!!!。。。。。。mysql -h 100.65.202.233 -P 4236 -u uds_root [email protected]/*-----------------------------------------*/create database shop;//创建一个数据库show databases; //查看有哪些数据库 use shop; //选择使用shop数据库 select database(); //查看当前选择的数据库show tables; //查看数据库中的表 select * from biao1; //查看biao1的数据 drop table chengji; //删除表chengji; show columns from biao1; //查看biao1 create table chengji(yingyu int,yuwen int,shuxue int);//新建chengji表,并插入响应字段 alter table chengji add meishu varchar(50) not null; //向表chengji中添加字段meishu; rename table chengji to chengji2; //把成绩改名为成绩2 show create table biao1; #查看建表语句select count(*) from mytable; #查看mytable表中的数据量常用操作实例:insert into t_XXX_search_config (FCorpUin,FDisplay,FTopPos,FQuality,FActivity) values(2852158899,4,10000,0,0) limit 1;update t_XXX_search_config set FDisplay = 888 where FCorpUin = 1820140703 limit 1;delete from XXXXX_BIZ.t_xxxxx_all where FKFUin = 800853466 limit 1;delete from table_name; #清除表数据 总结到此这篇关于CentOS7环境下MySQL8常用命令的文章就介绍到这了,更多相关CentOS7 MySQL8常用命令内容请搜索软件开发网以前的文章或继续浏览下面的相关文章希望大家以后多多支持软件开发网!
边栏推荐
- LeetCode 进阶之路 - 69.X的平方根
- 数据库系统概论 ---- 第一章 -- 绪论(重要知识点)
- Nodejs: official document 3 Dgram stream
- Introduction to database system -- Chapter 1 -- Introduction (important knowledge points)
- LeetCode 进阶之路 - 125.验证回文串
- Serial Print() and serial The difference of write() function, and the problem of hexadecimal and string sending and receiving format in serial port communication and detailed explanation of the conver
- Construction of RT thread smart win10 64 bit compilation environment
- Read the source code of micropyton - add the C extension class module (3)
- app测试用例
- C language -- 4 first-time constant
猜你喜欢

C language -- 1 c language cognition

Calculus review 1

「运维有小邓」自助帐户解锁工具

Understanding deep learning attention

Interview Essentials - basic knowledge of synchronized underlying principles

Junior high school graduates who choose secondary vocational schools can also be promoted to institutions of higher learning

Explain in detail the arithmetic operators related to matrix operation in MATLAB (addition, subtraction, multiplication, division, point multiplication, point division, power)

Which city should I go to after I graduate from it? Which position has a high salary? Which companies have good treatment?

入行须知:运维需要懂编程吗?

详解MATLAB中与矩阵运算有关的算术运算符(加、减、乘、除、点乘、点除、乘方)
随机推荐
LeetCode 进阶之路 - 169.多数元素
Theoretical basis of distributed services
蛮力法/1~n的全排列 v3 递归
C language -- 8 familiar keywords
详解MATLAB中与矩阵运算有关的算术运算符(加、减、乘、除、点乘、点除、乘方)
【无标题】破目
Is it safe to buy funds on mobile phones? Will the principal be swallowed?
LeetCode 进阶之路 - 加一
Redis cache avalanche
Leetcode advanced road - 169 Most elements
Qingniao Changping campus of Peking University: can I learn UI with a high school degree?
H265 Nalu类型判断及 sps 数据解析
Monitoring is easy to create a "quasi ecological" pattern and empower Xinchuang to "replace"
Nodejs: official document 3 Dgram stream
记录一下今天的MySQL故障
[untitled] broken item
Extracting Nalu unit data from H264 real-time stream
Leetcode advanced road - plus one
1、 Vulkan develops theoretical fundamentals
旋转菜单2.0