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

mysql2 nodejs pass table name as variable / right syntax to use near '??'

Hi I am trying to run a query but getting the following error: Nodej Mysql2 query tableName = "some_table" id = "some_id"; const readForwardedMessageDetails = pool.execute('SELECT * FROM ?? WHERE `id` = ? LIMIT 1', [tableName, id], …
DragonFire
  • 3,722
  • 2
  • 38
  • 51
-2
votes
1 answer

async function with MySQL SELECT request returns [object Promise] but writes correct answer in console

I started to create a bot for working with the MySQL database together with the vk-io module, but I came across an error that I did not understand The function below tries to pull one single value from the database, which is definitely there. This…
-2
votes
1 answer

How to use values of a hash dynamically?

Goal: Use unique email address in email header To: field (see message_class) of MIME Html Message. File: database.rb Here I connect to the database and I loop through the rows in table rcpt. Then I store the value in row["email"]. require…
Peter
  • 13
  • 7
-2
votes
1 answer

Rake db:create error, cannot find the solution

c:\row\dev\hello_world>db:create The filename, directory name, or volume label syntax is incorrect. c:\row\dev\hello_world>rake db:create c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activesupport-4.0.2/lib/active_support/values/time_zone.rb:282:…
-2
votes
2 answers

Mysql2::Error: after updating to Rails 4.1

I recently updated my Rails app from 4.0 to 4.1. Everything seems to work fine, except this one line in my Search Model that was working before. Essentially, I want to search/find District_Resources by Tag Name and by the District_Resource Name.…
Serge Pedroza
  • 2,160
  • 3
  • 28
  • 41
-2
votes
1 answer

Completed 500 Internal Server Error in Ruby on Rails

I'm trying to do a search but did not get any result. This is wrong: def BuscarRoles(usuario) @sql="SELECT * FROM rols WHERE id_rol IN (SELECT id_rol FROM rol_usuarios WHERE id_usuario = "+usuario.to_s+")" @roles =…
Carlos Mora
  • 13
  • 1
  • 2
-2
votes
1 answer

Access denied for user 'root'@'localhost' (using password: NO) (Mysql2::Error) when deploying Rails to Phusion Passenger

I'm getting the mentioned error when deploying a Rails app locally using Phusion Passenger. My config/database.yml file contains the following: production: adapter: mysql2 encoding: utf8 reconnect: false database: <%= ENV["DB_NAME"] %> …
1 2 3
60
61