当前位置:网站首页>MySQL related knowledge
MySQL related knowledge
2022-08-01 21:35:00 【【Heterogeneous space】】
MySQL related knowledge
Database Engine
- View Database Engine
show engines;
As you can see from the above figure, the InnoDB database supports transactions, row-level locks, foreign keys, savepoints
- Modify the database engine
Description: Adddefault-storage-engine=INNODB
under the mysqld module of the configuration file
After restarting the database service, check the engine information to see if the default engine is modified successfully
Database import and export
Database export
Description: dbname is the name of the database to be exported
# Log in to the server where mysql is located to export locallymysqldump -uroot -p111111 dbname >dbname.db.sql# Export the remote mysql database to the local hostmysqldump -uroot -p111111 -h 192.168.72.201 test >test.db.sql
- Database Import
# Log in to the server where mysql is located to import locallymysql -uroot -p111111 dbname <dbname.db.sql# Import from the local, import the device into the remote specified databasemysql -uroot -p111111 -h 192.168.72.201 test <test.db.sql
Slow query related
- View slow query information
show variables like "%slow%";
- Enable slow query
set global slow_query_log=on;
How to deal with forgotten MySQL database password
Add skip-grant-tables under the mysqld module
sed -i '1a skip-grant-tables' /etc/my.cnf
Restart the database service, and then you can log in without password through the mysql command
Change the user's password
# Change the passwordupdate mysql.user set password=password('123456') where user='root';# Inquireselect host,user,password from mysql.user;
Delete the mysqld module and add the skip-grant-tables field, restart the database service, and log in with the new password
# delete skip-grant-tables fieldsed -i '2d' /etc/my.cnf# Restart mysql database servicesystemctl restart mariadb# Login with new passwordmysql -uroot -p123456
边栏推荐
猜你喜欢
【接口测试】JMeter调用JS文件实现RSA加密
HCIP---企业网的架构
ORI-GB-NP半乳糖介导冬凌草甲素/姜黄素牛血清白蛋白纳米粒的研究制备方法
Image fusion GANMcC study notes
Port protocol for WEB penetration
How to choose Visibility, Display, and Opacity when interacting or animating
shell编程规范与变量
Jmeter combat | Repeated and concurrently grabbing red envelopes with the same user
基于php动漫周边商城管理系统(php毕业设计)
用户量大,Redis没法缓存响应,数据库宕机?如何排查解决?
随机推荐
作业8.1 孤儿进程与僵尸进程
Taobao's API to get the list of shipping addresses
P7215 [JOISC2020] 首都 题解
[@synthesize in Objective-C]
C Expert Programming Preface
C陷阱与缺陷 第7章 可移植性缺陷 7.10 首先释放,然后重新分配
Spark practice questions + answers
牛血清白蛋白刺槐豆胶壳聚糖缓释纳米微球/多西紫杉醇的纳米微球DTX-DHA-BSA-NPs
NFT的10种实际用途(NFT系统开发)
Appendix A printf, varargs and stdarg a. 2 use varargs. H to realize the variable argument list
对C语言结构体内存对齐的理解
基于php在线考试管理系统获取(php毕业设计)
PyQt5 + MySQL5.8 【学生信息管理系统】【增删改查】
CS-NP白蛋白包覆壳聚糖纳米颗粒/人血清白蛋白-磷酸钙纳米颗粒无机复合材料
JSD - 2204 - Knife4j framework - processing - Day07 response results
Spark shuffle tuning
位运算简介
多商户商城系统功能拆解19讲-平台端发票管理
JSD-2204-Knife4j框架-处理响应结果-Day07
File operations of WEB penetration