Комментарии:
It's not working in my case (Ruby-2.3.3), mysql2 (0.5.2 x86-mingw32) when I do >rake db:create. I am getting: c:\row\dev\hello_world>rake db:create
Access denied for user 'root'@'localhost' (using password: YES)
Couldn't create 'hello_world_development' database. Please check your configuration.
rake aborted!
Mysql2::Error::ConnectionError: Access denied for user 'root'@'localhost' (using password: YES)
how come mine keep showing this ...c:/jruby/Ruby200/lib/ruby/gems/2.3.0/gems/mysql2-0.4.4-x86-mingw32/lib/mysql2/client.rb:87:in `connect': Access denied for user 'root'@'localhost' (using password: YES) (Mysql2::Error)
from c:/jruby/Ruby200/lib/ruby/gems/2.3.0/gems/mysql2-0.4.4-x86-mingw32/lib/mysql2/client.rb:87:in `initialize'
from test.rb:3:in `new'
from test.rb:3:in `<main>'
please help
Why so much effort to install one program?
ОтветитьHi
I can't get Mysql to install. While installing I get the following message -Mysql Internal error object reference not set to an instance of an object the installer will now close. Any suggestions?
Thank you for creating such great tutorials, sub'd and liked.
ОтветитьI'm on Windows 10 and following. I had no problem with the test.rb like he did. But then I also had installed the msi version of the sql C connector but I'm not sure if that did anything. But libmsql.dll is in that lib dir of the program files mysql dir. And so I did put that mysql/bin on the PATH. But just do what he says and you should be fine. Sqlite was the same way back in the day. You might have to put that dll in the ruby bin.
ОтветитьHi i have followed this this but am getting this error, please help me out- {access denied for user 'root'@'localhost' (using password yes)}
ОтветитьHi Jonathan Thanks for grate tutorial i have issue could u pls tell me what can i do?
c:\row\dev\mysql_test>ruby test.rb
C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.4.1-x86-mingw32/lib/mysql2/client.rb:79:in `connect': Unknown MySQL server host 'local' (0) (Mysql2::Error)
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.4.1-x86-mingw32/lib/mysql2/client.rb:79:in `initialize'
from test.rb:3:in `new'
from test.rb:3:in `<main>'
In the step where we are finding the mysql.exe: What do i do if this is located on our work server, and it's not publicly available? I do have mySQL workbench setup on my station. Do I link through this? Or should I get access to the servers mysql section from our IT department?
Thanks for the awesome videos, can't wait to be riding on rails.
Hi Jonathan, I need your HELP. I am having problems with this MySQL connector. I am using ruby 2.1 now and the error is as below:
DL is deprecated, please use Fiddle
C:/row/Ruby21/lib/ruby/gems/r.1,0/gems/mysql2-0.3.18/lib/mysql2/client.rb
‘connect’ :Lost connection to MySQL server at ‘waiting for initial communication packet’, system error: 0 (Mysql2::Error)
From c:/row/Ruby21/lib/ruby/gem/2.1.0/gem/mysql2-0.3.18/lib/mysql/client.rb:70:in ‘initialize’
from test.rb:3:in ‘new’
from test.rb:3:in ‘new’
ok so after much piddling about I have uninstall ruby22 and now have ruby21....I have now got the TIMESTAMP :-) lets hope everything just WORKS from here on .... only spent 3-4 or maybe 5 days trying to get anything working ...
ОтветитьTo all of you having the problem with C:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
: cannot load such file -- mysql2/2.2/mysql2 (LoadError, then you have installed Ruby 2.2, uninstall download ruby 2.1.6 it worked for me
Hi when testing the connector I cannot get it to work.
I am getting a load error on mysql2/2.2/mysql2. I ran the gem install but it didn't use the devkit when it installed. it said the install was successful but the output from the install said it installed the binary file. any help?
For the command of typing "gem install mysql2...etc... " Do we have to find the most recent mysql number instead of mysql2? It says that the latest version is 5.7 on the website...
Ответитьgetting this error even after added the path of connecter ->
C:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
: cannot load such file -- mysql2/2.2/mysql2 (LoadError)
from C:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54
:in `require'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x86-mingw32/li
b/mysql2/mysql2.rb:2:in `<top (required)>'
from C:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54
:in `require'
from C:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54
:in `require'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x86-mingw32/li
b/mysql2.rb:31:in `<top (required)>'
from C:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:12
8:in `require'
from C:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:12
8:in `rescue in require'
from C:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39
:in `require'
from test.rb:1:in `<main>'
Is it possible I am unable to do the test because I have the version 2.2 ?
ОтветитьHi Jonathan,
Thanks for the awesome video. I am getting the following error(s) when trying to run the test.rb file:
C:\row\dev\mysql_test>ruby test.rb
C:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
: cannot load such file -- mysql2/2.2/mysql2 (LoadError)
from C:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54
:in `require'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x86-mingw32/li
b/mysql2/mysql2.rb:2:in `<top (required)>'
from C:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54
:in `require'
from C:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54
:in `require'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x86-mingw32/li
b/mysql2.rb:31:in `<top (required)>'
from C:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:12
8:in `require'
from C:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:12
8:in `rescue in require'
from C:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39
:in `require'
from test.rb:1:in `<main>'
after installing the gem
this is what I got: Successfully installed mysql2-0.3.18.-x86-mingw32
why is it x86. I followed step by step but different outcome. Please HELP.
Hey! well... im having some troubles on the last step of this video, it keeps callin this error
c:\row\dev\mysql_test>ruby test.rb
c:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
: cannot load such file -- mysql2/2.2/mysql2 (LoadError)
from c:/row/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54
:in `require'
im kinda nervous because i need get started asap with ruby on rails, any help would be appreciated
Thx!
I can not understand what went wrong ...
client = Mysql2::Client.new(host: 'localhost', username: 'root', password: 'fkjsdkjlksd')
C:\row\dev\mysql_test>ruby test.rb
DL is deprecated, please use Fiddle
C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.18-x86-mingw32/lib/mysql2/cli
ent.rb:70:in `connect': Access denied for user 'root'@'localhost'(using passwor
d: YES) (Mysql2::Error)
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.18-x86-mingw32/l
ib/mysql2/client.rb:70:in `initialize'
from test.rb:3:in `new'
from test.rb:3:in `<main>'
client = Mysql2::Client.new(host: 127.0.0.1, username: 'root', password: 'daksldklkask')
C:\row\dev\mysql_test>ruby test.rb
test.rb:3: no .<digit> floating literal anymore; put 0 before dot
...Mysql2::Client.new(host: 127.0.0.1, username: 'root', passwo...
... ^
test.rb:3: syntax error, unexpected tFLOAT, expecting '('
...ql2::Client.new(host: 127.0.0.1, username: 'root', password:...
... ^
Im getting an error about mysql2? when i try to install the Gem ? But i was able to log in with root and my passwd
ОтветитьI have MYSQL Installed & found the Bin folder In Profile (x86) but it did not contain the Mysql.exe file . and the normal profile folder did contain Msql but not the Mysql server or a Bin folder
ОтветитьYeah I just went back and validated I followed everything and I still get this:
c:\row\dev>cd mysql_test
c:\row\dev\mysql_test>ruby test.rb
c:/row/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
: cannot load such file -- mysql2 (LoadError)
from c:/row/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55
:in `require'
from test.rb:1:in `<main>'
c:\row\dev\mysql_test>ruby test.rb
c:/row/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
: cannot load such file -- mysql2 (LoadError)
from c:/row/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55
:in `require'
from test.rb:1:in `<main>'
c:\row\dev\mysql_test>
johnatan, I have followed your instructions to the letter and when I get to the part where I run the test.rb I receive the following error. What could I have possibly missed?
c:\row\dev\mysql_test>ruby test.rb
c:/row/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
: cannot load such file -- mysql2 (LoadError)
from c:/row/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55
:in `require'
from test.rb:1:in `<main>'
c:\row\dev\mysql_test>
Every time I try to install MySQL I get to the set up page and when choosing "Server Only" it returns the message "Unable to determine the products that correspond with that set up type" (It returns the same message regardless of which option I choose). Then when pressing next there is nothing to install.
Do you NEED MySQL to start learning Ruby on Rails? Are there any others that can be used? Or a fix for the above?
Thanks.
THIS IS WHAT I GET WHEN I TRY GETTING THE TIMESTAMP.
c:\row\dev\mysql_test>ruby test.rb\
ruby: Invalid argument -- test.rb/ (LoadError)
c:\row\dev\mysql_test>ruby test.rb
C:/row/Ruby200/lib/ruby/gems/2.1.0/gems/mysql2-0.3.17/lib/mysql2/client.rb:70:in
`connect': Access denied for user 'root'@'localhost'(using password: YES) (Mys
ql2::Error)
from C:/row/Ruby200/lib/ruby/gems/2.1.0/gems/mysql2-0.3.17/lib/mysql2/cl
ient.rb:70:in `initialize'
from test.rb:3:in `new'
from test.rb:3:in `<main>'
c:\row\dev\mysql_test>
Hi Jonathan ,I am getting the following error.Please help!
C:/row/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
: Incorrect MySQL client library version! This gem was compiled for 6.0.0 but th
e client library is 5.1.73. (RuntimeError)
from C:/row/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55
:in `require'
from C:/row/Ruby21/lib/ruby/gems/2.1.0/gems/mysql2-0.3.16/lib/mysql2.rb:
8:in `<top (required)>'
from C:/row/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:13
5:in `require'
from C:/row/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:13
5:in `rescue in require'
from C:/row/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:14
4:in `require'
from test.rb:2:in `<main>'
what is the solution.Please tell.
noob here. when I get to the end to run ruby test.rb i get the following error:
test.rb:3:in '<main>': undefined method 'client' for Mysql2:Module (NoMethodError)
(btw, how do i copy it from the command prompt?). Any suggestions on this error? thx
Hello. I get this error in the end of the instructions in the video:
c:\row\dev\mysql_test>ruby test.rb
c:/row/Ruby200/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require
': Incorrect MySQL client library version! This gem was compiled for 6.0.0 but t
he client library is 5.1.73. (RuntimeError)
Wrong dll? How do I solve it? Thank you.
I was fine till the end:
c:\row>cd dev
c:\row\dev>cd mysql_test
c:\row\dev\mysql_test>ruby test.rb
c:/row/Ruby21/lib/ruby/gems/2.1.0/gems/mysql2-0.3.16/lib/mysql2/client.rb:70:in
`connect': Access denied for user 'gabeleahy'@'localhost'(using password: YES)
(Mysql2::Error)
from c:/row/Ruby21/lib/ruby/gems/2.1.0/gems/mysql2-0.3.16/lib/mysql2/cli
ent.rb:70:in `initialize'
from test.rb:3:in `new'
from test.rb:3:in `<main>'
c:\row\dev\mysql_test>
this is the error im getting! Please Help :(
c:/row/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.16/lib/mysql2/client.rb:70:in
`connect': Can't connect to MySQL server on 'localhost' (10061) (Mysql2::Error)
from c:/row/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.16/lib/mysql2/cl
ient.rb:70:in `initialize'
from test.rb:3:in `new'
from test.rb:3:in `<main>'
Hi Jonathan, Thanks a lot for your Step by Step Instrucion Videos. They helped me a lot. By the way - Hint for all others: Make sure, your Antivirus-Tool is set off for installing the mysql connector. Oherwise it will only produce errors.
Ответитьдля тебя отдельный котелок в аду
ОтветитьHard to get a tutorial like this by googling. All other tutorials are very unclear.
ОтветитьVery simple and straightforward. You sir, are a lifesaver!
ОтветитьWhat if you don't have MySQL install already, how do you install it ?
ОтветитьHi Jonathan!
On running the file test.rb, i am getting the following error message and i am not getting any way to move out from this. Please help...
C:\row\dev\mysql_test>ruby test.rb
C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.16/lib/mysql2/client.rb:70:in `connect'
: Can't connect to MySQL server on 'localhost' (10061) (Mysql2::Error)
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.16/lib/mysql2/client.rb:70
:in `initialize'
from test.rb:3:in `new'
from test.rb:3:in `<main>'
Every step went fine, until the very end:
it appears like this
C:\row\dev\mysql_test>ruby test.rb
C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.16/lib/mysql2/client.rb:70:in
`connect': Unknown MySQL server host 'local host' (0) (Mysql2::Error)
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.16/lib/mysql2/cl
ient.rb:70:in `initialize'
from test.rb:3:in `new'
from test.rb:3:in `<main>'
C:\row\dev\mysql_test>
*****************************
plz help :(
Do I have to create an online account for it to be able to log into?
ОтветитьI end up getting this > from test.rb:5: in 'new' from test.rb:5: in '<main>' < ? Does this mean I made it work? lol because I did all the steps to fix the path and then install the mysql2 gem was installed .
I did exactly the same as you and i keep getting this error: "You have to install development tools first."
ОтветитьHi when I am trying to set up I'm getting the following error. Please help me
C:\row\dev\mysql_test>ruby test.rb
C:/row/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in 'require' : cannot load such file -- mysql2 <LoasErrror>
from C:/row/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in 'require'
from test.rb:1:in '<main>'