Ruby on Rails Mysql::Error: Unknown system variable 'NAMES': SET NAMES 'utf8'

by Cliff 11. January 2009

If you receive the following error message Mysql::Error: Unknown system variable 'NAMES': SET NAMES 'utf8' when trying to run MySQL with ruby on rails it may be due to the version of MySQL you are running.  I was receiving this error when running a basic ROR app as well as when trying to run a migration rake db:migrate.

Turns out I was using MySQL version 4.0.12-nt which is not supported with the most recent version of rails. 

 I had MySQL 5.1 running on a different port, so I also needed to update the database.yml file to specify the port.  If you need to specify a MySQL port with rails, you need to add port: to the yml file...mine ended up looking like: 

  host: localhost
  port: 3307

 With those changes in place, I was then able to run my rails app and migrations.

Related posts

Comments are closed

Cliff Gray's Info

Cliff Gray
Developer/Founder GrayTechnology.com.

E-mail me Send mail

Authors

Calendar

<<  September 2019  >>
MoTuWeThFrSaSu
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

View posts in large calendar

Blogroll

Download BlogEngine.NET

Download at CodePlex

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2019

Subscribe