mysql学习之数据引擎的示例代码分享
技术百科
黄舟
发布时间:2017-03-25
浏览: 次 插件式存储引擎是mysql数据库最重要的特征之一,用户可以根据应用的需要寻找如何存储和索引数据、是否使用事务等。mysql默认支持多种存储引擎,以适用于不同领域的数据库应用需求,用户可以通过选择选择不同的存储引擎提供应用的效率,提供灵活的存储
查看当前数据库支持的引擎
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
# 端口号
相关栏目:
<?muma
$count = M('archives')->where(['typeid'=>$field['id']])->count();
?>
【
AI推广<?muma echo $count; ?>
】
<?muma
$count = M('archives')->where(['typeid'=>$field['id']])->count();
?>
【
SEO优化<?muma echo $count; ?>
】
<?muma
$count = M('archives')->where(['typeid'=>$field['id']])->count();
?>
【
技术百科<?muma echo $count; ?>
】
<?muma
$count = M('archives')->where(['typeid'=>$field['id']])->count();
?>
【
谷歌推广<?muma echo $count; ?>
】
<?muma
$count = M('archives')->where(['typeid'=>$field['id']])->count();
?>
【
百度推广<?muma echo $count; ?>
】
<?muma
$count = M('archives')->where(['typeid'=>$field['id']])->count();
?>
【
网络营销<?muma echo $count; ?>
】
<?muma
$count = M('archives')->where(['typeid'=>$field['id']])->count();
?>
【
案例网站<?muma echo $count; ?>
】
<?muma
$count = M('archives')->where(['typeid'=>$field['id']])->count();
?>
【
精选文章<?muma echo $count; ?>
】
相关推荐
- c++中如何对数组进行排序_c++数组排序算法汇总
- Python音视频处理高级项目教程_FFmpegP
- 如何在Golang中处理JSON字段缺失_Gola
- PHP 中如何在函数内持久修改引用变量所指向的目标
- 如何高效识别并拦截拼接式恶意域名 spam
- Windows10系统怎么查看CPU温度_Win1
- Win10系统怎么查看显卡温度_Win10任务管理
- c++ stringstream用法详解_c++字
- Windows 11怎么更改锁屏超时时间_Wind
- Win11如何设置系统声音_Win11系统声音调整
- Win11开机速度慢怎么优化_Win11系统启动加
- C#如何在一个XML文件中查找并替换文本内容
- C++ static_cast和dynamic_c
- Python包结构设计_大型项目组织解析【指导】
- 如何在Mac上搭建Golang开发环境_使用Hom
- XML的“混合内容”是什么 怎么用DTD或XSD定
- Win11如何设置电源计划_Win11电源计划优化
- mac怎么安装字体_MAC添加第三方字体与字体册管
- MAC怎么用连续互通相机里的“桌上视角”_MAC在
- 如何快速验证Golang安装是否成功_运行go v
- Windows如何查看和管理已安装的字体?(字体文
- Win11怎么开启上帝模式_创建Windows 1
- Win10怎样清理C盘爱奇艺缓存_Win10清理爱
- Win11讲述人怎么关闭_Win11误触开启语音朗
- Windows 11无法安全删除U盘提示设备正在使
- Win11怎么设置ip地址_Windows 11手
- 如何使用Golang实现容器健康检查_监控和自动重
- 怎么将XML数据可视化 D3.js加载XML
- php增删改查需要哪些扩展_开启mysqli或pd
- Win11任务栏怎么调到左边_Win11开始菜单居
- Windows10怎样设置家长控制_Windows
- PHP主流架构怎么集成Redis缓存_配置步骤【方
- Win11怎么关闭贴靠布局_Win11禁用窗口最大
- c++如何判断文件是否存在_c++ filesys
- Win11键盘快捷键大全_Windows 11常用
- 如何在Golang中优化文件读写性能_使用缓冲和并
- Windows10无法识别USB设备描述符请求失败
- 如何使用正则表达式提取以编号开头、后接多个注解的逻
- Win11怎么关闭右下角弹窗_Win11拦截系统通
- Win10怎样清理C盘浏览器缓存_Win10清理浏
- Win11怎么关闭搜索历史_Win11清除设备上的
- Win11怎么关闭透明效果_Windows11个性
- GML (Geography Markup Lan
- Python邮件系统自动化教程_批量发送解析与模板
- PHP接收参数值为空怎么办_判断和处理空参数方法说
- Win11怎么查看电脑配置_Win11硬件配置详细
- php报错怎么查看_定位PHP致命错误与警告的方法
- windows 10应用商店区域怎么改_windo
- php485读数据时阻塞怎么办_php485非阻塞
- PHP主流架构怎么处理表单验证_规则与自定义【技巧

******* 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)
QQ客服