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
1 answer

RoR error - Mysql2::Error Access denied for user 'root'@'localhost'

I have one ruby on rails site running and working. I have created a new project and pointed the subdomain to it. That all worked. I changed the database.yml to a new user I created in my database and I run rake db:create without any issues and the…
Mike
  • 127
  • 12
0
votes
1 answer

Rails4 new application creation - Bundler expecting version MySQL2 3.1.3?

I'm starting to experiment with Rails 4 for work where we are using the MySQL2 3.1.0 gem on the server. Locally with Ruby 2.0, I installed the MySQL2 3.1.0 Gem and everything was fine there (matching the gem version on the work server basically just…
Reno
  • 2,962
  • 9
  • 41
  • 68
0
votes
1 answer

Load Error for Ruby on Rails mysql2

Nubie at Ruby on Rails so I wanted to build a "Hello World" style of app to get familiar with RoR. The app I chose, along with tutorial on installation, was Dave Berube's "checkbook" app as in…
0
votes
1 answer

Ruby script Cannot connect to MySQL Database using mysql2 gem

Im trying to connect my ruby script to the local mysql database located here: which mysql /usr/local/mysql/bin/mysql Ive got these gems installed which ruby /Users/AM/.rvm/rubies/ruby-2.0.0-p247/bin/ruby gem list ...... mysql2…
banditKing
  • 9,405
  • 28
  • 100
  • 157
0
votes
1 answer

ROR: connecting two databases and moving data from one table to another table

I have two applications called app1 & app2, I have connected two database using connection establish method. I have same table name in both the databases, now I want to send selected data from app2 to app1. Here is my code for connecting two…
Pavan
  • 1
  • 2
0
votes
1 answer

Rails 4, RSpec, MySQL2 default value error on first factory only

I'm upgrading from Rails 3.2.14 to Rails 4. When running RSpec on my test suite in my Rails 3 branch, all tests pass. On the Rails 4 branch, however, I'm getting an error on the first instance only of creating a factory. The error…
mikeknep
  • 31
  • 1
  • 5
0
votes
1 answer

Could not find gem 'mysql2 (>= 0) ruby' in the gems available on this machine

I installed rails on my computer, made under this instruction -https://coderwall.com/p/auvm9g When installing a new project - rails new my_project -d mysql Installing mysql2 (0.3.13) Gem::Installer::ExtensionBuildError: ERROR: Failed to build…
0
votes
1 answer

Connect from Mac Rails app to MySQL running on Windows 7 machine?

I'm trying to connect my rails app running on my Mac to MySQL running on my Windows 7 machine. They are both on the same network at my house, and I can ping my Windows machine from my Mac. Trying to execute rake db:create I get this error: Host…
sbonkosky
  • 2,537
  • 1
  • 22
  • 31
0
votes
2 answers

`heroku open` fails - table doesn't exist error in logs

Edit: While trying to get this working, I commented out the offending factory_girl entirely - and it's still giving the same error - cannot load such file -- factory_girl_rails /app/lib/tasks/sample_data.rake:1:in require' is there something i…
dax
  • 10,779
  • 8
  • 51
  • 86
0
votes
2 answers

[help]ActiveRecord::ConnectionNotEstablished

my rails environment is Rails: 3.2.14, ruby: 1.9.3, system: ubuntu mysql: 5.5.32-0ubuntu0.12.04.1 I create a mysql database,and to test the database, I connect It from my mysql workbench in windows.so, I want to show that,my mysql database in ubuntu…
HXH
  • 1,643
  • 4
  • 19
  • 31
0
votes
0 answers

Mysql2::Error: Access denied for user 'swapnasa'@'localhost' (using password: NO) (Sequel::DatabaseConnectionError)

I trying to conect a Ruby application to MySQL databases. Every time I get the below error: /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Mysql2::Error: Access denied for user…
phulei
  • 55
  • 1
  • 8
0
votes
1 answer

rake aborted Permission denied - /home/u/eol/db/structure.sql

I run the command: rake eol:db:recreate RAILS_ENV=development And this happens: rake aborted! Permission denied - /home/u/eol/db/structure.sql How can I solve this problem?
0
votes
1 answer

Mysql2 database integration in a rails app(parser), which is based on Mechanize

I made a parser(ruby file), which is based on Mechanize and put it in a model (I created model by rails generator with all attributes e.g name:string, email:string, etc and did a migration) in the rails app (whether correctly I did?). But I don't…
Arty
  • 15
  • 5
0
votes
1 answer

Ruby Mysql2::Error: Can't connect to MySQL server on 'localhost' (10061) on Windows 7

I am working on windows rails application . I have created rb file for that application. I am able to connect to mysql via appliction but when I am trying to connect it via ruby code , error is coming for connecting mysql. I am working on the…
Arpit Vaishnav
  • 4,739
  • 6
  • 39
  • 57
0
votes
2 answers

Can't connect to MySQL server on 'myhost.com' (4)

I'm able to connect to the remote database from a MySQL client and using terminal as well. But when trying to access the database from the Rails app, I got this error: Mysql2::Error (Can't connect to MySQL server on 'myhost.com' (4)) My database.yml…
rocir
  • 472
  • 1
  • 4
  • 9