This project is archived and is in readonly mode.
User mysql2 taked uninitialized constant Mysql error.
-
huacnlee (at gmail)
This is Rails3 Rc2 my database.yml:
development:
adapter: mysql encoding: utf8 reconnect: false database: homeland_development pool: 5 username: monster password: 123123 host: 172.28.150.23 -
huacnlee (at gmail)
last is wrong, I use mysql2 not mysql
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: homeland_development
pool: 5
username: monster
password: 123123
host: 172.28.150.23 -
Andrew White
- Importance changed from to Low
You need to have mysql2 in your Gemfile not mysql - works fine for me in a new app.
-
huacnlee (at gmail)
I was installed mysql2! and I found the resolvtion.
when I change database.yml to:
development:
adapter: mysql2 encoding: utf8 reconnect: false database: "homeland_development" pool: 5 username: "monster" password: "123123" host: "172.28.150.23"add quotes to string value, but why?
-
Andrew White
- Milestone cleared.
- State changed from new to open
- Assigned user set to Andrew White
- Importance changed from Low to High
The problem is that YAML is treating your password as a integer and the Mysql2 library generates an exception when passed a Fixnum for the password. The db:create task assumes that mysql is available and tries to rescue the error but the error class is Mysql2::Error not Mysql::Error so you get the undefined constant error.
The attached patch fixes the db:create task and I've raised an issue on http://github.com/brianmario/mysql2
-
Repository
- State changed from open to resolved
(from [241dfa3c90838957d85022e81d777247e451d832]) Catch mysql2 access denied errors in rake db:create [#5432 User mysql2 taked uninitialized constant Mysql error. state:resolved]
Signed-off-by: Xavier Noria fxn@hashref.com
http://github.com/rails/rails/commit/241dfa3c90838957d85022e81d7772... -
Repository
(from [1fbb0684d267ca61e9409206c9939d0aeab609c9]) Catch mysql2 access denied errors in rake db:create [#5432 User mysql2 taked uninitialized constant Mysql error. state:resolved]
Signed-off-by: Xavier Noria fxn@hashref.com
http://github.com/rails/rails/commit/1fbb0684d267ca61e9409206c9939d... -
The_Lord
It certainly works with database adapter set to mysql2, but still fails when using em_mysql2 (also provided with the mysql2 gem).
-
The_Lord
Allright it works now with rails 3.0 final release.
