请帮我弄清楚错误
#1286 - Unknown storage engine 'InnoDB'
运行此查询:
CREATE TABLE IF NOT EXISTS `tbl_prize` (
`prize_id` int(11) NOT NULL,
`prize` int(11) NOT NULL,
`chance` int(11) NOT NULL DEFAULT '1'
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
ALTER TABLE `tbl_prize` ADD PRIMARY KEY (`prize_id`);
ALTER TABLE `tbl_prize` MODIFY `prize_id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
INSERT INTO `tbl_prize` (`prize_id`, `prize`, `chance`) VALUES(1, 100, 1),(2, 200, 1);
CREATE TABLE IF NOT EXISTS `tbl_user` (
`user_id` int(11) NOT NULL,
`reffer_id` int(11) DEFAULT NULL,
`wallet` varchar(500) NOT NULL,
`ref_pending` int(11) unsigned NOT NULL DEFAULT '0',
`earn` int(11) unsigned NOT NULL DEFAULT '0',
`playnum` int(11) unsigned NOT NULL,
`ip` int(10) unsigned DEFAULT NULL,
`reset` int(4) unsigned NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `tbl_user`
ADD PRIMARY KEY (`user_id`),
ADD KEY `reffer_id` (`reffer_id`),
ADD KEY `username` (`wallet`),
ADD KEY `ref_pending` (`ref_pending`),
ADD KEY `ip` (`ip`),
ADD KEY `reset` (`reset`);
ALTER TABLE `tbl_user`
MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `tbl_user`
ADD CONSTRAINT `tbl_user_ibfk_1` FOREIGN KEY (`reffer_id`) REFERENCES `tbl_user` (`user_id`) ON DELETE SET NULL;
最佳答案
MySQL 服务器通常使用以下存储引擎之一进行配置:
您的问题出在查询的 ENGINE=InnoDB 部分。如果您不关心存储引擎,您最终可以尝试删除它。
另一种解决方案(如果您不了解数据库服务器则比较困难)是更改配置中的存储引擎。如果您能够/被授权这样做,请使用 InnoDB 配置您的数据库引擎。找到my.cnf文件,将default-storage-engine设置为InnoDB。还应更改其他参数以使其正常工作(请参阅引用资料)。
注意:如果您的MySQL服务器已经有数据,您需要提前备份。
引用资料:
关于mysql - #1286 - 未知存储引擎 'InnoDB',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43067254/
我正在尝试测试是否存在表单。我是Rails新手。我的new.html.erb_spec.rb文件的内容是:require'spec_helper'describe"messages/new.html.erb"doit"shouldrendertheform"dorender'/messages/new.html.erb'reponse.shouldhave_form_putting_to(@message)with_submit_buttonendendView本身,new.html.erb,有代码:当我运行rspec时,它失败了:1)messages/new.html.erbshou
我在我的项目目录中完成了compasscreate.和compassinitrails。几个问题:我已将我的.sass文件放在public/stylesheets中。这是放置它们的正确位置吗?当我运行compasswatch时,它不会自动编译这些.sass文件。我必须手动指定文件:compasswatchpublic/stylesheets/myfile.sass等。如何让它自动运行?文件ie.css、print.css和screen.css已放在stylesheets/compiled。如何在编译后不让它们重新出现的情况下删除它们?我自己编译的.sass文件编译成compiled/t
我主要使用Ruby来执行此操作,但到目前为止我的攻击计划如下:使用gemsrdf、rdf-rdfa和rdf-microdata或mida来解析给定任何URI的数据。我认为最好映射到像schema.org这样的统一模式,例如使用这个yaml文件,它试图描述数据词汇表和opengraph到schema.org之间的转换:#SchemaXtoschema.orgconversion#data-vocabularyDV:name:namestreet-address:streetAddressregion:addressRegionlocality:addressLocalityphoto:i
我在我的项目中添加了一个系统来重置用户密码并通过电子邮件将密码发送给他,以防他忘记密码。昨天它运行良好(当我实现它时)。当我今天尝试启动服务器时,出现以下错误。=>BootingWEBrick=>Rails3.2.1applicationstartingindevelopmentonhttp://0.0.0.0:3000=>Callwith-dtodetach=>Ctrl-CtoshutdownserverExiting/Users/vinayshenoy/.rvm/gems/ruby-1.9.3-p0/gems/actionmailer-3.2.1/lib/action_mailer
在MRIRuby中我可以这样做:deftransferinternal_server=self.init_serverpid=forkdointernal_server.runend#Maketheserverprocessrunindependently.Process.detach(pid)internal_client=self.init_client#Dootherstuffwithconnectingtointernal_server...internal_client.post('somedata')ensure#KillserverProcess.kill('KILL',
我已经从我的命令行中获得了一切,所以我可以运行rubymyfile并且它可以正常工作。但是当我尝试从sublime中运行它时,我得到了undefinedmethod`require_relative'formain:Object有人知道我的sublime设置中缺少什么吗?我正在使用OSX并安装了rvm。 最佳答案 或者,您可以只使用“require”,它应该可以正常工作。我认为“require_relative”仅适用于ruby1.9+ 关于ruby-主要:Objectwhenrun
我花了三天的时间用头撞墙,试图弄清楚为什么简单的“rake”不能通过我的规范文件。如果您遇到这种情况:任何文件夹路径中都不要有空格!。严重地。事实上,从现在开始,您命名的任何内容都没有空格。这是我的控制台输出:(在/Users/*****/Desktop/LearningRuby/learn_ruby)$rake/Users/*******/Desktop/LearningRuby/learn_ruby/00_hello/hello_spec.rb:116:in`require':cannotloadsuchfile--hello(LoadError) 最佳
我想在一个没有Sass引擎的类中使用Sass颜色函数。我已经在项目中使用了sassgem,所以我认为搭载会像以下一样简单:classRectangleincludeSass::Script::FunctionsdefcolorSass::Script::Color.new([0x82,0x39,0x06])enddefrender#hamlengineexecutedwithcontextofself#sothatwithintemlateicouldcall#%stop{offset:'0%',stop:{color:lighten(color)}}endend更新:参见上面的#re
我已经像这样安装了一个新的Rails项目:$railsnewsite它执行并到达:bundleinstall但是当它似乎尝试安装依赖项时我得到了这个错误Gem::Ext::BuildError:ERROR:Failedtobuildgemnativeextension./System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/rubyextconf.rbcheckingforlibkern/OSAtomic.h...yescreatingMakefilemake"DESTDIR="cleanmake"DESTDIR="
关闭。这个问题需要detailsorclarity.它目前不接受答案。想改进这个问题吗?通过editingthispost添加细节并澄清问题.关闭8年前。Improvethisquestion在首页我有:汽车:VolvoSaabMercedesAudistatic_pages_spec.rb中的测试代码:it"shouldhavetherightselect"dovisithome_pathit{shouldhave_select('cars',:options=>['volvo','saab','mercedes','audi'])}end响应是rspec./spec/request