尝试使用 Rails 创建数据库时出错,rake db:create [英] Error when trying to create database with Rails, rake db:create
问题描述
我使用的是 Ruby1.9 和 Rails 2.3.4,并且安装了 mysql-ruby (2.8.1) gem.
I'm using Ruby1.9 and Rails 2.3.4 and I have mysql-ruby (2.8.1) gem installed.
当我尝试 rake db:create 我得到以下内容
when I try rake db:create I get the following
无法创建数据库{适配器"=>mysql",数据库"=>war_development",用户名"=>root",密码"=>nil,主机"=>本地主机"},字符集:utf8,整理:utf8_unicode_ci(如果你设置手动设置字符集,请确保您有一个匹配的排序规则)
Couldn't create database for {"adapter"=>"mysql", "database"=>"war_development", "username"=>"root", "password"=>nil, "host"=>"localhost"}, charset: utf8, collation: utf8_unicode_ci (if you set the charset manually, make sure you have a matching collation)
我的database.yml有以下用于开发
My database.yml has the following for development
development:
adapter: mysql
database: war_development
username: root
password:
host: localhost
知道出了什么问题吗?
谢谢,
谭
推荐答案
root 用户可以不用密码吗?mysqlserver 是监听 127.0.0.1 还是本地主机?
Are you allowed to use the root user without password? Is the mysqlserver listening on 127.0.0.1 or localhost?
这篇关于尝试使用 Rails 创建数据库时出错,rake db:create的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!