如何使MySQL数据库在内存中完全运行? [英] How do I make a MySQL database run completely in memory?

查看:1245
本文介绍了如何使MySQL数据库在内存中完全运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到我的数据库服务器支持内存数据库引擎。我想创建一个数据库,我已经运行InnoDB完全在内存中运行性能。

I noticed that my database server supports the Memory database engine. I want to make a database I have already made running InnoDB run completely in memory for performance.

我该怎么做?我探索了PHPMyAdmin,我找不到更改引擎功能。

How do I do that? I explored PHPMyAdmin, and I can't find a "change engine" functionality.

推荐答案

假设您了解使用在评论中提及的MEMORY引擎,以及此处 ,以及通过搜索(没有事务安全,锁定问题等)可以找到的其他一些 - 您可以按照下列步骤操作:

Assuming you understand the consequences of using the MEMORY engine as mentioned in comments, and here, as well as some others you'll find by searching about (no transaction safety, locking issues, etc) - you can proceed as follows:

MEMORY表存储方式不同比InnoDB,所以你需要使用导出/导入策略。首先使用 SELECT * FROM tablename INTO OUTFILE'table_filename'将每个表分别转储到一个文件。创建MEMORY数据库并重新创建要使用的表。然后,您可以使用 LOAD DATA INFILE'table_filename'INTO TABLE tablename 为每个表导入数据。

MEMORY tables are stored differently than InnoDB, so you'll need to use an export/import strategy. First dump each table separately to a file using SELECT * FROM tablename INTO OUTFILE 'table_filename'. Create the MEMORY database and recreate the tables you'll be using. You can then import your data using LOAD DATA INFILE 'table_filename' INTO TABLE tablename for each table.

这篇关于如何使MySQL数据库在内存中完全运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆