How do you start mySQL under InstantRails?

I don’t know why but mySQL is not running when InstantRails starts. I
cannot seem to figure out how to get it running. It’s there in the mysql
directory. I have “C:\InstantRails\mysql\bin;” as the first entry in my
PATH variable. Maybe I am trying to start it in the wrong place? Right
now I tried running “mysqld” in the C:\InstantRails\mysql\bin and it
seems to be hanging…

I just tried running “mysql” within the bin directory and now I get
this…

ERROR 1045 (28000): Access denied for user ‘ODBC’@‘localhost’ (using
password: NO)

Hi Tom,

Without a little more info, I’m not sure how to direct you. MySQL should
start when you start IR.exe. Plz say more.

Best regards,
Bill

----- Original Message -----
From: “Tom D.” [email protected]
To: [email protected]
Sent: Sunday, December 02, 2007 5:01 PM
Subject: [Rails] Re: How do you start mySQL under InstantRails?

Bill W. wrote:

Hi Tom,

Without a little more info, I’m not sure how to direct you. MySQL should
start when you start IR.exe. Plz say more.

Thanks, I’m not sure what else to provide, but what I finally did was
this:

C:\InstantRails\mysql\bin>mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.27-community

Then tried to go to my page, and it finally worked.

I guess it wanted to know I was the root user? I thought it was supposed
to start at startup as you say.

Gareth Howells wrote:

The command ‘mysql’ which you entered is the client, not the server.
If you were able to login using ‘mysql -u root’ then it means that the
server is starting correctly. Only the MySQL server is loaded when
InstantRails starts, not the client, as the client is not used by
Rails.

Ok, maybe I’m misunderstanding what was happening then. When I first hit
my application, it wouldn’t connect. After I logged into mysql - it
did. Is there something I need to do in the application itself to ensure
that connection is made?

The command ‘mysql’ which you entered is the client, not the server.
If you were able to login using ‘mysql -u root’ then it means that the
server is starting correctly. Only the MySQL server is loaded when
InstantRails starts, not the client, as the client is not used by
Rails.

On Dec 3, 1:19 am, Tom D. [email protected]

On Mon, 03 Dec 2007 02:43:03 +0100, Tom D. wrote:

Ok, maybe I’m misunderstanding what was happening then. When I first hit
my application, it wouldn’t connect.

There was nothing to connect to. The mysql server was down, it’s like
trying to load a page in firefox when the server on the other end is
down: error 404. Once the mysql server was up and running then rails
can connect to it :slight_smile:

-Thufir

Yes, before running a Rails program you should login to MySQL as the
user
who ‘owns’ the database for that program, and then enter the command
‘USE
databasename;’ where databasename is the name of the database for the
program.


Gareth Howells
Grey College JCR
IT Officer and Technical Services Manager
University of Durham
07862725134
----- Original Message -----
From: “Tom D.” [email protected]
To: [email protected]
Sent: Monday, December 03, 2007 1:43 AM
Subject: [Rails] Re: How do you start mySQL under InstantRails?

Tom D. wrote:

I’m still slightly confused on this… how do I start mySQL then when I

on instant rails… it installs in a directory, alone, not like another
windows
istallers. it makes an instant rails folder. there is an
Instantrails.exe file in the instantrails folder. Double click on
instantrails.exe (make a link to it). that will load apache and mysql.
then, you should have a little red ‘I’ in the bottom right of the
screen. it flashs some yellow when running.

right click on that I, and select RAILS APPLICATIONS > MANAGE RAILS
APPLICATIONS.
the rails app should be there. check it, and start mongrel. leave the
terminal running, just minimize it.

there you go… mysql, apache, and mongrel. there are more options…
:wink:

I’m still slightly confused on this… how do I start mySQL then when I
first load up IR? I tried to begin a new project today, and when I tried
to create the db I got the connection error. IR said mySQL was running.
I used the IR console to restart mysql - which then send it was
“pending” not running. I also tried doing ‘mysqld’ in the mysql
directory. Shortly after that I was able to create the db and log into
it, so I’m not sure what actually got it going.

The mysqld command never seemed to execute in the command window… I
finally closed it (it seemed hung up). Sorry for this total newb
questions, what seems like it should be obvious to me just isn’t…

gemblon (t.b.) wrote:

Tom D. wrote:

I’m still slightly confused on this… how do I start mySQL then when I

on instant rails… it installs in a directory, alone, not like another
windows
istallers. it makes an instant rails folder. there is an
Instantrails.exe file in the instantrails folder. Double click on
instantrails.exe (make a link to it). that will load apache and mysql.
then, you should have a little red ‘I’ in the bottom right of the
screen. it flashs some yellow when running.

This much I was okay with…

right click on that I, and select RAILS APPLICATIONS > MANAGE RAILS
APPLICATIONS.
the rails app should be there. check it, and start mongrel. leave the
terminal running, just minimize it.

there you go… mysql, apache, and mongrel. there are more options…
:wink:

What does starting the mongrel server have to do with getting mysql to
run?

On Tue, 18 Dec 2007 16:49:08 +0100, Tom D. wrote:

I’m still slightly confused on this… how do I start mySQL then when I
first load up IR?

There’s a MySQL group for a better explanation, but…

Think of of a web server, be it mongrel, webrick or apache. That web
server must be started, yes? Similarly, there’s a mySQL server which
must be started. If mongrel/webrick isn’t running, then going to
localhost:3000 will give “page cannot be displayed”, right? You’re
getting the same thing, but from the MySQL server.

I forget, are you using Linux or Windows? In GNOME for Linux, I can
navigate to System > Administration > Services then enter my root
password and turn on the mysql “service”. Alternately, from the command
line:

arrakis ~ #
arrakis ~ # /etc/init.d/mysql stop

  • Stopping mysql …
  • Stopping mysqld
    (0)
    [ ok ]
    arrakis ~ #
    arrakis ~ # /etc/init.d/mysql start
  • Starting mysql …
  • Starting mysql (/etc/mysql/
    my.cnf) [ ok
    ]
    arrakis ~ #
    arrakis ~ # /etc/init.d/mysql restart
  • Stopping mysql …
  • Stopping mysqld
    (0)
    [ ok ]
  • Starting mysql …
  • Starting mysql (/etc/mysql/
    my.cnf) [ ok
    ]
    arrakis ~ #

-Thufir

Tom D. wrote in post #595906:

Bill W. wrote:

Hi Tom,

Without a little more info, I’m not sure how to direct you. MySQL should
start when you start IR.exe. Plz say more.

Thanks, I’m not sure what else to provide, but what I finally did was
this:

C:\InstantRails\mysql\bin>mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.27-community

Then tried to go to my page, and it finally worked.

I guess it wanted to know I was the root user? I thought it was supposed
to start at startup as you say.

Thanks
The above method perfectly connects with mysql.