Forum: Ruby on Rails Windows+Ruby+MySQL

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Alex P. (Guest)
on 2007-01-27 03:59
Hi!
I am newer to here & to Ruby generally.
But have got a problem while trying to set up Ruby, Rails & MySQL.
1. Installed Ruby
2. Installed Rails
3. Installed RadRails
4. In RadRails created Rails project 'test'. While creating, checked
boxes:
   - Generate Rails application sceleton
   - Create a WEBrick server
5. In RadRails generated 'mycontroller' controller. While was creating
it, got a
   message in Console "./script/../config/boot.rb:29:Warning:
require_gem is
   obsolete.  Use gem instead.". But creating was successfull.
6. In RadRails generated 'mymodel' model. Got the same message in
Console. But
   creating was successfull as well.
7. Started WEBrick server on port 3000. Checked by
http://localhost:3000.
   Working!
8. Edited mycontroller_controller.rb:
    "class MycontrollerController < ApplicationController
           def index
           render_text "My Controller is working"
           end
     end".
   Checked by http://localhost:3000/mycontroller. Working!
9. Installed MySQL. While was installing checked 'off' the box with
login & pass requiremts of the server. When started MySQL Command Line
client, it asks for the password :(
10. Installed HeidiSQL.
11. While WEBrick server is running on port 3000, was trying to connect
by HeidiSQL to:
    hostname: localhost
    user: root
    password:
    port: 3306

...and got an SQL Error: "Can't connect to MySQL server on 'localhost'
(10061)"

Can't understand where my problem is. Could somebody possibly advice me
what to do?

Thank you.
gmarik (Guest)
on 2007-01-27 04:25
(Received via mailing list)
By default empty password should work:
try mysql client in command line shell:
$ mysql -uroot -p
hit enter and enter (empty password).

On Jan 27, 3:59 am, Alex P. <removed_email_address@domain.invalid>
gmarik (Guest)
on 2007-01-27 04:27
(Received via mailing list)
Previous post may not seem obvious, but you actually have to hit enter
twice! :)
Alex P. (Guest)
on 2007-01-27 04:36
gmarik wrote:
> By default empty password should work:
> try mysql client in command line shell:
> $ mysql -uroot -p
> hit enter and enter (empty password).
>
> On Jan 27, 3:59 am, Alex P. <removed_email_address@domain.invalid>

thx for the answer!
when I start MySQL command line shell. It says: "Enter password:". :(
when I try by command line:

>C:\Program Files\MySQL\MySQL Server 4.1\bin>mysql -uroot -p
>Enter password:
I push 'enter'.
>ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
Alex P. (Guest)
on 2007-01-27 04:45
my database.yml file:
development:
  adapter: mysql
  database: test_development
  username: root
  password:
  host: localhost


I know it's wrong, because my 'db' directory is empty.
But I dont know what to do :(
Jeff C. (Guest)
on 2007-01-27 05:32
(Received via mailing list)
On Jan 26, 8:36 pm, Alex P. <removed_email_address@domain.invalid>
wrote:
> gmarik wrote:
> >C:\Program Files\MySQL\MySQL Server 4.1\bin>mysql -uroot -p
> >Enter password:
> I push 'enter'.
> >ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)--
> Posted viahttp://www.ruby-forum.com/.

In addition the mysql command line client, there is a mysql Windows
service that needs to be running that the command-line tool is going to
try to connect to.

Usually, the MySQL installer asks you if you want to start the service
automatically, but perhaps this was missed.  Check your Windows
services in the control panel and make sure that a "MySQL" service has
been started.  If it's not even listed, then something went haywire
during the install.

Jeff
softiesonrails.com
Alex P. (Guest)
on 2007-01-27 06:50
Jeff C. wrote:
> In addition the mysql command line client, there is a mysql Windows
> service that needs to be running that the command-line tool is going to
> try to connect to.
>
> Usually, the MySQL installer asks you if you want to start the service
> automatically, but perhaps this was missed.  Check your Windows
> services in the control panel and make sure that a "MySQL" service has
> been started.  If it's not even listed, then something went haywire
> during the install.
>
> Jeff
> softiesonrails.com

Thank you for the answer.
I suppose it doesnt even start.
When configuring MySQL Server 4.1 it says:
>-  Prepare configuration
>-  Write configuration file
>X  Start service

>The service could not be started. Error:0
And the same: can't do anything :((
Don't know what to do...
Jeff C. (Guest)
on 2007-01-27 07:43
(Received via mailing list)
On Jan 26, 10:50 pm, Alex P. <removed_email_address@domain.invalid>
wrote:
> Jeff C. wrote:
> >The service could not be started. Error:0And the same: can't do anything :((
> Don't know what to do...

I remember having this problem once a while back... I think I basically
uninstalled MySQL, rebooted my Windows box, then re-installed.  I'm not
100% sure that cured it, but it's worth a try, even though I know it
sounds illogical.

There may also my a more detailed mysql log file somewhere on your hard
drive, though I'm not exactly sure where it would be.

Jeff
Mathias W. (Guest)
on 2007-01-27 09:36
(Received via mailing list)
On 1/27/07, Alex P. <removed_email_address@domain.invalid> wrote:
> Thank you for the answer.
> I suppose it doesnt even start.
> When configuring MySQL Server 4.1 it says:
> >-  Prepare configuration
> >-  Write configuration file
> >X  Start service
>
> >The service could not be started. Error:0
> And the same: can't do anything :((
> Don't know what to do...

Do you still have HeidiSQL running? Does it run on port 3306 too? If
so, shut down HeidiSQL and try starting MySQL from the Services
control panel. Sometimes the installer just fails at starting up the
server, but if you go into the Services control panel you can
sometimes start it up manually yourself (and then it should work every
time you boot from that time on).

You could also try navigating a command prompt to your MySQL
installation directory, and into the /bin/ dir and there try to run
mysqld.exe, this may or may not occupy that command prompt for as long
as you want the server running and may not give you any output. I've
been running MySQL like that a while not too long ago (when I didn't
want it as a service).

Hope that helps,
Mathias.
Alex P. (Guest)
on 2007-01-27 16:27
> Do you still have HeidiSQL running? Does it run on port 3306 too? If
> shut down HeidiSQL and try starting MySQL from the Services
> control panel.

Doesnt' help. When I try to start MySQL from Services there is an error
message:
"Could not start the MySQL server on Local Computer.
Error 1067: The process terminated unexpectedly"

> I think I basically uninstalled MySQL, rebooted my Windows box, then
> re-installed
Tried few times to do so. Doesn't help. :(
Kevin W. (Guest)
on 2007-01-27 23:05
The MySQL docs have lots of troubleshooting info.
http://dev.mysql.com/doc/refman/4.1/en/windows-ins...

You might want to run the configuration wizard a few times and see if it
can fix itself.

If I remember correctly, the 5.0.x installer works better than the
4.1.x. You might want to try that if you're not tied to 4.1.

About the password-less access, leave off the "-p" argument. "mysql
-uroot" should work better. That is, of course, after you get the
service running.

Hope that helps
Alex P. (Guest)
on 2007-01-27 23:16
Thanks to all! Its working now! But only with password...
I have reinstalled MySQL totally, restarted PC. Installed again MySQL.
Entered password. And it works now but only with password.
This topic is locked and can not be replied to.