
December 3rd, 2009, 09:10 PM
|
|
|
|
MySQL connection
Hi, I am trying to set up a Rails app with a MySQL database at the back end. The database.yml connection section looks like this after Rails created it automatically:
Code:
development:
adapter: mysql
encoding: utf8
reconnect: true
database: test
pool: 5
username: <username>
password: <pwd>
host: localhost
When I start up "ruby script/console" and try to save a record with <ClassName>.new, nothing happens in the DB and I get this error message:
Code:
Commands out of sync; you can't run this command now: SET NAMES utf8
I remove the "encoding: utf8" line from database.yml and try to do the same. Then I get this message:
Code:
Commands out of sync; you can't run this command now: SET SQL_AUTO_IS_NULL
So, it looks like Rails is trying to run some MySQL commands. Why is this happening and how to stop these messages?
Thanks.
|