Questions tagged [mysql2]

The Mysql2 gem is meant to serve the extremely common use-case of connecting, querying and iterating on results.

The mysql2 gem is an interface for accessing MySQL databases from Ruby. This gem is an incompatible improvement over the original mysql gem.

Links:

907 questions
0
votes
2 answers

Install mysql2 on Mac OS

I've install Ruby 2, Rails 4 and MySQL (with homebrew). I tried to install the gem "mysql2" but i got this message : gem install mysql2 Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to…
guilb
  • 119
  • 1
  • 2
  • 11
0
votes
1 answer

Relax datetime validation on mysql 5.6.10 with my.cnf

My inserting format YYYY-MM-DDTHH:MM:SSZ, but this is incorrect. I want to treat YYYY-MM-DDTHH:MM:SSZ as YYYY-MM-DD HH:MM:SS, how to set my.cnf or other solution? ActiveRecord::StatementInvalid: Mysql2::Error: Incorrect datetime value:…
Matt - sanemat
  • 5,418
  • 8
  • 37
  • 41
0
votes
1 answer

Rails 4 issue with mysql database tables after upgrading from Rails 3.2

I have upgraded recently my app to Rails 4 (from Rails 3.2). But seems that the app doesn't find anymore some mysql tables, for example a table called Accidents. In the app I find this error: Mysql2::Error: Table 'gms.accidents' doesn't exist: SHOW…
0
votes
1 answer

Deployed Rails3 but not showing up outside of server

I just deployed my Rails3 app to a linux server with Capistrano and Unicorn using mysql2. I keep getting the error "Oops! Google Chrome could not connect to 172.16.128.125" when trying to access the app in a browser. What is weird is that I see no…
Hoffmann
  • 53
  • 2
0
votes
1 answer

Unable to boot rails server using mysql2

Here is the error... C:\Sites\simple_cms>rails s > => Booting WEBrick > => Rails 3.2.13 application starting in development on http://X.X.X.X:3000 > => Call with -d to detach > => Ctrl-C to shutdown…
sHnaCk
  • 1
0
votes
2 answers

Can't Connect to remote Mysql server in Rails, but I can connect to it with command line client

I have a remote Mysql server, and got all privileges remotely. Here is the output of "show grants" after I logged in remotely, from local…
tuo
  • 586
  • 1
  • 4
  • 20
0
votes
1 answer

Issues installing mysql or mysql2 gem

I have ruby version 2.0.0.0p195 (2013-05-14) [x64-mingw32] installed as well as ruby gem version 2.0.3 installed. I just recently installed MySQL Community Server 5.6.12 (32 bit) installer as well. I am trying to get the mysql or mysql2 gem to work…
kmalik
  • 109
  • 1
  • 2
  • 11
0
votes
5 answers

Please install mysql2 adapter

I'm new of rails, and i have this big problem. I'm running rails 3.2.9 and Ruby 1.9.3, I did a porting of a rails app from linux to windows, but in windows i'm having a lot of problems with mysql2 gem. I installed mysql2 gem yesterday and than i…
0
votes
2 answers

Issue with Mysql2, RoR, and Windows 8 x64

Okay so I've been having a heck of a time getting my IDE environment setup for Ruby and RoR. Every issue so far I've been able to solve except one so I humbly ask the mighty stackoverflow for guidance. MY RubyMine install is having trouble…
0
votes
1 answer

Mysql InnoDB error in Rails 3 when i run rake db:migrate

Mysql2::Error: Unknown table engine 'InnoDB': SHOW FULL FIELDS FROM schema_migrations This is the error I see when i run rake db:migrate. I am using mysql server 5.1 and rails 3.2.7 Please help me solve this problem
shishirmk
  • 425
  • 2
  • 14
0
votes
1 answer

Ruby: Shorthand for associative hash/array from mysql2 result set

So, new to ruby and struggling on this: images table - 2 columns, filename and md5 using the mysql2 extension images = Hash.new results = client.query("SELECT * FROM images").each do |row| images[row['filename']] = row['md5'] end i'd like to…
0
votes
0 answers

Error starting rails server after creating new app using mysql

I'm following the Lynda Ruby on Rails 3 Essential Training videos and just created a new rails application preconfigured to use a MySQL database using: rails new app -d mysql I then went into the /app directory and tried to start the rails…
ukejoe
  • 1
0
votes
1 answer

Installing mysql2 gem - HAVE_UINT (ushort, uint type redefinition errors)

Yes, this is yet another question about installing the mysql2 gem for use in Ruby on Rails. But it's an error I haven't been able to find listed in another question. I've got the 64 bit MySQL and RVM installed on OS X Mountain Lion. When trying to…
Tom Hamming
  • 10,577
  • 11
  • 71
  • 145
0
votes
2 answers

Splitting an Array in Ruby

I am fetching some data from the database as below in my ruby file: @main1= $connection.execute("SELECT * FROM builds WHERE platform_type LIKE 'TOTAL';") @main2= $connection.execute("SELECT * FROM builds WHERE …
Pi Horse
  • 2,350
  • 8
  • 30
  • 51
0
votes
2 answers

failed require 'mysql2'

I am having trouble requiring the mysql2 gem. On my local copy it works just fine but on the vm where I am trying to run my script the require fails. Here is the info for the VM. Windows 7 64bit Ruby 1.9.3 MySQL 5.6 mysql2 gem 0.3.11…
Zach
  • 885
  • 2
  • 8
  • 27