"Rolling with Ruby" for Linux?

P

Phil Tomson

I'm finally getting around to trying out Rails and I'm using Curt Hibbs'
OnLamp article to get me going.

Problem is it's for Windows. The article refers to MySQLfront which
appears to be a Windows only program for setting up and maintaining the
database. I'm thinking that I probably need mysql_administrator in the
case of Linux so I downloaded it and tried it. So far I haven't been
able to connect to the database.

I downloaded MySQL for Linux and followed the installation instructions
and then started mysql_safe as indicated in the installation readme that
comes with mysql. But when I run MySQL administrator and try to log in I
keep getting a popup window that says "Could not connect to host
'localhost' MySQL Error Nr. 2002...".

I'm wondering if anyone has modified Curt's tutorial for use on Linux?

Phil
 
J

James Edward Gray II

I'm wondering if anyone has modified Curt's tutorial for use on Linux?

Have you tried the command-line client installed with MySQL?

$ mysql -u username -p

See if that gets you anywhere.

James Edward Gray II
 
J

Jim Freeze

* James Edward Gray II said:
Have you tried the command-line client installed with MySQL?

$ mysql -u username -p

See if that gets you anywhere.

James Edward Gray II

Or, try adding your machine to the list of allowed hosts
in the mysql table.
 
P

Phil Tomson

Have you tried the command-line client installed with MySQL?

$ mysql -u username -p

See if that gets you anywhere.

OK, that seems to be better. I get:

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.11-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>


I've got to admit I've never used any kind of database before (hey, I've
hashes right? :). So I'm getting the idea that 'root' in this case (the
username I used above in the mysql command) is not the same as root on my
system - correct?

Also, now that I've got this mysql> commandline, I'm not quite sure what
to do next. Curt's tutorial talks about creating a new database called
'cookbook'. 'help' doesn't reveal a 'new' or 'add' command. I tried
'use cookbook' but of course it replies that it doesn't know about a
database called 'cookbook'.

Phil
 
P

Phil Tomson

Or, try adding your machine to the list of allowed hosts
in the mysql table.

I figured out why mysql_administrator wouldn't connect. It was trying to
connect through a non-existant socket file at: /var/lib/mysql (somewhere
in there). The actual socket file was in /tmp/mysql.sock Now
mysql_administrator seems to be running OK.

Phil
 
J

Jon Raphaelson

Phil said:
OK, that seems to be better. I get:

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.11-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>


I've got to admit I've never used any kind of database before (hey, I've
hashes right? :). So I'm getting the idea that 'root' in this case (the
username I used above in the mysql command) is not the same as root on my
system - correct?

Also, now that I've got this mysql> commandline, I'm not quite sure what
to do next. Curt's tutorial talks about creating a new database called
'cookbook'. 'help' doesn't reveal a 'new' or 'add' command. I tried
'use cookbook' but of course it replies that it doesn't know about a
database called 'cookbook'.

Phil

Phil

First, to create a database with the cli for mysql, type this at the
command line:

mysql> create database <name>.

Second - unfortunatly the CLI for mysql is a little dumb about where it
puts it's help imho. When you are looking for help about SQL or pretty
much any server side mysql stuff, start by typing

mysql> help contents

just typing help lists commands that the cli takes, not the db.
 
L

Lyndon Samson

I'm finally getting around to trying out Rails and I'm using Curt Hibbs'
OnLamp article to get me going.

Problem is it's for Windows. The article refers to MySQLfront which
appears to be a Windows only program for setting up and maintaining the
database. I'm thinking that I probably need mysql_administrator in the
case of Linux so I downloaded it and tried it. So far I haven't been
able to connect to the database.
A great article, but I'm a bit surprised at the proportion of GUI
screenshots, it would have been nice to have create table sql/ddl
scripts instead/as well.
 
C

Curt Hibbs

Lyndon said:
A great article, but I'm a bit surprised at the proportion of GUI
screenshots, it would have been nice to have create table sql/ddl
scripts instead/as well.

That was a conscious decision on my part. The idea was to bring those
who were used to things like VB and MS Access. I figured people who
preferred command line interfaces would have no problem figuring out
what they needed to do.

Covering both ways of was not an option either. The article was already
too long, and I actually had to cut things out to get it down to size.

Curt
 
K

Ken Ismert

As an Access/VB developer, I can say I definitely liked the article.
I've bookmarked Part 2, and intend to study both these articles
further. To be honest, Ruby was nothing more than a mild curiosity to
me until I read about Rails. The idea of a simple, straightforward
web/database framework (to the uninitiated, it looks TOO simple to
work) has also piqued my interest in Ruby. I am attracted to the idea
of diving in and getting productive results fast, without cloistering
myself for years trying to fathom the (perceived) complexities of the
..NET-based web frameworks.

Right now, I am evaluating my current development platform and
practices, because I feel they aren't productive enough. I'm pretty
certain I will be doing .NET development in the future, but I don't
wholly buy the MS evangelism on the productivity of their platform (If
its so good, why isn't Longhorn on time and under-budget?)

Any comments/suggestions would be welcome.

-Ken
 
P

Phil Tomson

That was a conscious decision on my part. The idea was to bring those
who were used to things like VB and MS Access. I figured people who
preferred command line interfaces would have no problem figuring out
what they needed to do.

It took me a while, but after I got the mysql_administator tool running I
was able to get through the tutorial. (I actually had to learn a bit of
SQL to do it as well, which is probably a good thing.)

Nice article. And I can see why everyone is excited about RoR. I'm
hoping to put something together to track student grades for my TA job.

Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,079
Latest member
ElidaWarin

Latest Threads

Top