mysql学习笔记之数据引擎

作者:hebedich 时间:2024-01-25 12:38:28 

查看当前数据库支持的引擎


show engines
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine       | Support | Comment                            | Transactions | XA  | Savepoints |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| InnoDB       | DEFAULT | Supports transactions, row-level locking, and foreign keys   | YES     | YES | YES    |
| MRG_MYISAM     | YES   | Collection of identical MyISAM tables             | NO      | NO  | NO     |
| MEMORY       | YES   | Hash based, stored in memory, useful for temporary tables   | NO      | NO  | NO     |
| BLACKHOLE     | YES   | /dev/null storage engine (anything you write to it disappears) | NO      | NO  | NO     |
| MyISAM       | YES   | MyISAM storage engine                     | NO      | NO  | NO     |
| CSV        | YES   | CSV storage engine                       | NO      | NO  | NO     |
| ARCHIVE      | YES   | Archive storage engine                     | NO      | NO  | NO     |
| PERFORMANCE_SCHEMA | YES   | Performance Schema                       | NO      | NO  | NO     |
| FEDERATED     | NO   | Federated MySQL storage engine                 | NULL     | NULL | NULL    |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
9 rows in set (0.00 sec)

或者


show engines \G
mysql> show engines \G
*************************** 1. row ***************************
  Engine: InnoDB
  Support: DEFAULT
  Comment: Supports transactions, row-level locking, and foreign keys
Transactions: YES
    XA: YES
Savepoints: YES
*************************** 2. row ***************************
  Engine: MRG_MYISAM
  Support: YES
  Comment: Collection of identical MyISAM tables
Transactions: NO
    XA: NO
Savepoints: NO
*************************** 3. row ***************************
  Engine: MEMORY
  Support: YES
  Comment: Hash based, stored in memory, useful for temporary tables
Transactions: NO
    XA: NO
Savepoints: NO
*************************** 4. row ***************************
  Engine: BLACKHOLE
  Support: YES
  Comment: /dev/null storage engine (anything you write to it disappears)
Transactions: NO
    XA: NO
Savepoints: NO
*************************** 5. row ***************************
  Engine: MyISAM
  Support: YES
  Comment: MyISAM storage engine
Transactions: NO
    XA: NO
Savepoints: NO
*************************** 6. row ***************************
  Engine: CSV
  Support: YES
  Comment: CSV storage engine
Transactions: NO
    XA: NO
Savepoints: NO
*************************** 7. row ***************************
  Engine: ARCHIVE
  Support: YES
  Comment: Archive storage engine
Transactions: NO
    XA: NO
Savepoints: NO
*************************** 8. row ***************************
  Engine: PERFORMANCE_SCHEMA
  Support: YES
  Comment: Performance Schema
Transactions: NO
    XA: NO
Savepoints: NO
*************************** 9. row ***************************
  Engine: FEDERATED
  Support: NO
  Comment: Federated MySQL storage engine
Transactions: NULL
    XA: NULL
Savepoints: NULL
9 rows in set (0.00 sec)

Engine 引擎的名称
Support 是否支付YES表示支持,NO表示不支持
Comment 评价或者备注 Defalut表示,默认支持的引擎
Transactions 是否支持事务,YES表示支持,NO表示不支持
XA 所有支持的分布式是否符合XA规范,YES表示支持,NO表示不支持
Savepoints 是否支持事务处理中的保存点,YES表示支持,NO表示不支持

或者

show variables like ‘have%'


mysql> show variables like 'have%';
+------------------------+----------+
| Variable_name     | Value  |
+------------------------+----------+
| have_compress     | YES   |
| have_crypt       | NO    |
| have_dynamic_loading  | YES   |
| have_geometry     | YES   |
| have_openssl      | DISABLED |
| have_profiling     | YES   |
| have_query_cache    | YES   |
| have_rtree_keys    | YES   |
| have_ssl        | DISABLED |
| have_statement_timeout | YES   |
| have_symlink      | YES   |
+------------------------+----------+
11 rows in set, 1 warning (0.00 sec)

Variable_name 引擎名称
value 是否支持YES支持,NO不支持,DISABLED表示支持但未启用

查看默认引擎

show variables like ‘%storage_engine%'


mysql> show variables like '%storage_engine%';
+----------------------------------+--------+
| Variable_name          | Value |
+----------------------------------+--------+
| default_storage_engine      | InnoDB |
| default_tmp_storage_engine    | InnoDB |
| disabled_storage_engines     |    |
| internal_tmp_disk_storage_engine | InnoDB |
+----------------------------------+--------+
4 rows in set, 1 warning (0.00 sec)

InnoDB 为默认引擎

修改默认引擎

my.ini文件


[mysqld]
# The next three options are mutually exclusive to SERVER_PORT below.
# skip-networking
# enable-named-pipe
# shared-memory
# shared-memory-base-name=MYSQL
# The Pipe the MySQL Server will use
# socket=MYSQL
# The TCP/IP Port the MySQL Server will listen on 默认端口号
port=3306
# Path to installation directory. All paths are usually resolved relative to this. 服务器的默认安装目录
# basedir="C:/Program Files/MySQL/MySQL Server 5.7/"
# Path to the database root  数据库数据文件的目录
datadir=C:/ProgramData/MySQL/MySQL Server 5.7\Data
# The default character set that will be used when a new schema or table is
# created and no character set is defined 修改服务器默认字符
character-set-server=utf8
# The default storage engine that will be used when create new tables when
# 这里修改默认引擎
default-storage-engine=INNODB

修改后重启Mysql服务

标签:mysql,学习笔记,数据引擎
0
投稿

猜你喜欢

  • 使用Python将xmind脑图转成excel用例的实现代码(一)

    2021-11-10 12:35:42
  • Python爬取世界杯热搜榜并制作脚本自动发送信息到邮箱的过程

    2021-01-21 20:35:53
  • python入门学习之自带help功能初步使用示例

    2021-05-27 17:07:28
  • Python接口测试数据库封装实现原理

    2024-01-27 11:19:46
  • Django中的FBV和CBV用法详解

    2023-09-15 10:41:06
  • Pytorch如何切换 cpu和gpu的使用详解

    2023-08-22 03:30:11
  • opencv形态学中的孔洞填充详细图解

    2021-08-14 00:44:10
  • 最新Linux系统下安装MySql 5.7.17全过程及注意事项

    2024-01-17 07:40:56
  • Go语言的队列和堆栈实现方法

    2024-05-09 09:40:13
  • python笔记_将循环内容在一行输出的方法

    2022-08-11 20:27:09
  • python学习数据结构实例代码

    2023-09-20 22:56:32
  • MySQL 原理与优化之Update 优化

    2024-01-17 03:03:35
  • 写一个简单的bat脚本执行php文件

    2024-03-07 09:18:12
  • 如何查看SQLSERVER中某个查询用了多少TempDB空间

    2024-01-16 06:40:21
  • 将备份的SQLServer数据库转换为SQLite数据库操作方法

    2024-01-23 18:52:52
  • perl 删除数组元素的几种方法小结

    2023-07-14 18:31:11
  • numpy的文件存储.npy .npz 文件详解

    2023-02-08 17:16:35
  • Python垃圾回收机制三种实现方法

    2023-02-22 00:24:42
  • SQL中的开窗函数(窗口函数)

    2024-01-24 09:59:43
  • MySQL 客户端不输入用户名和密码直接连接数据库的2个方法

    2024-01-14 05:30:41
  • asp之家 网络编程 m.aspxhome.com