后来我用IDE了,里面的命令是: D:\Ruby1.9.2\Ruby192\bin\rake db:migrate rake aborted! Can't connect to MySQL server on 'localhost' (10061)
Tasks: TOP => db:migrate (See full trace by running task with --trace)
请大家帮个忙,给我点建议和帮助,帮我带上路,谢谢! [解决办法] >gem list
看看有 这个gem没有。
mysql2 (0.2.6 x86-mingw32)
没有就gem install mysql2 [解决办法] 你MySQL可能没开 [解决办法] maybe you can add 'host: loaclhost' in your database.yml. but this isn't mandatory. default value is localhost.
rake db:create this command will create development and test database in your mysql server. the error message has told you. you cannot connect mysql server.
so, first you need to check mysql server status. make sure mysql is running and you can access your mysql server from you local machine. second, you need to check mysql rubygem, make sure it has been installed. you can use 'gem list' to check it. third, make sure the 'ruby_project_development' exists in your mysql database. 'rake db:create' this command will create it. hope this is helpful for you.
#3楼的内容我来给翻译一下啊! maybe you can add 'host: loaclhost' in your database.yml. but this isn't mandatory. default value is localhost. 可能你需要追加'host: localhost'到你的database.yml文件中, 但并非一定要这样做, 因为默认值是localhost.
rake db:create this command will create development and test database in your mysql server. the error message has told you. you cannot connect mysql server. 这条命令将创建开发模式数据库及测试数据库到你的mysql服务器中. 错误信息已经告诉你了, 你没能连接到mysql服务器.
so, first you need to check mysql server status. make sure mysql is running and you can access your mysql server from you local machine. second, you need to check mysql rubygem, make sure it has been installed. you can use 'gem list' to check it. third, make sure the 'ruby_project_development' exists in your mysql database. 'rake db:create' this command will create it. hope this is helpful for you. 因此首先, 你需要检查一下你的mysql服务器状态. 确定mysql正在运行并且你能够从本机访问到你的mysql服务器. 其次, 你需要检查mysql rubygem, 确定它已经被安装了. 你可以使用'gem list'命令来确定mysql rubygem. 再次, 确定'ruby_project_development'存在于你的mysql数据库中. 'rake db:create'命令会创建它. 希望这些对你有所帮助.