我已经在mysql上创建了HEAP(ram)表,以加快查询速度.但是在mysql服务器重启后,我的堆表中的数据没有被加载.
I have created HEAP (ram) table on mysql for faster query. But after mysql server restarted, the data in my Heap tables is not loaded.
我的常规表名称:ID为productisname的产品,状态为myisam
My normal table name: products with id, product_name, status as myisam
id => 整数和自动递增的主键
id => integer and auto_increment, primary key
产品名称=> var_char和键(索引)
product_name => var_char and key(index)
状态=> 布尔值
实际查询:
`Select id from products where product_name like "product_name"`我想提高速度,因此我创建了具有与mysql HEAP表相同的结构并命名为 products_ram 的表. 我正在使用此代码进行填充:
I want to increase speed, so i created table with same structure and with named products_ram as mysql HEAP table. I am using this code for fill:
insert p_shop.products_ram select * from p_shop.products;但是,当重启mysql实例HEAP(ram)表数据时,就消失了.
But when restart mysql instance HEAP (ram) table data has gone.
我找到了有关mysql内存存储的文档: dev.mysql/doc/refman /5.0/en/memory-storage-engine.html
I found a document about mysql memory storage : dev.mysql/doc/refman/5.0/en/memory-storage-engine.html
但是我找不到我想要的东西.
But i can't find what i looking for.
我想将产品表中的数据自动插入/复制到mysql服务器初始化中的products_ram表中.
I want to insert/copy my data from products table to products_ram table on mysql server initialization automatically.
任何帮助将不胜感激.
我的操作系统:Windows Server 2008 R2 和Mysql:MySQL 5.5
My Operating System : Windows Server 2008 R2 And Mysql : MySQL 5.5
推荐答案init_file 服务器选项可让您定义要在启动时执行的任意SQL语句.
The init_file server option lets you define arbitrary SQL statements to be executed on startup.
随着资源在目标站点上移动,更改了链接.
Changed the link as the resource has moved on the target site.
更多推荐
在MySQL服务启动时运行SQL查询
发布评论