安装rail时候自带的sqlite3数据库连不上。老说no such file to load -- sqlite3。所以换用mysql连接
好久没用myslq了。都有点忘记了。先启动mysqld。然后登一下mysql试试能不能用。恩
然后安装ruby-mysql-0.2.6,按照readme安装。在test。rb时候发现又错了
显示
Client does not support authentication protocol requested
by server; consider upgrading MySQL client
按照
http://dev.mysql.com/doc/refman/5.0/en/old-client.html
中的说法。改了密码
mysql> SET PASSWORD FOR
-> 'some_user
'@'some_host
' = OLD_PASSWORD('newpwd
');
这下就能顺利安装了
接着配置config/database.yml
请看我的配置
development:
adapter: mysql
encoding: utf8
database: temp_test
username: ×××××
password: ×××××
socket: /var/run/mysql/mysql.sock
# adapter: sqlite3
# database: db/development.sqlite3
# timeout: 5000
最后rake db:migrate
一切ok