Monday, August 2, 2010

MySQL --- Getting Started

 
I love the MySQL tutorial. Which tutorial?
The one provided by the official documentation.

The official tutorial starts with this section
that tells you how to connect to and disconnect
from the server:

Connecting to and Disconnecting from the Server

Note that not all MySQL servers will let you
connect to the server remotely. Some do not
allow this, probably for security reasons.

Even if you can't connect to the server directly,
this is still a valuable section. It gives you
some kind of sense of how to work with MySQL
interactively.

However, some hosting companies will not allow you
to connect directly to the MySQL server and some
only allow you to enter interactive commands in
a text terminal that they provide on their website
after you have logged in.

I've seen both situations.

If your hosting company does not allow you to
connect to your MySQL database directly, do not
lose hope. There is always a way.

One way is to enter commands in the text window
they may provide. If they don't provide you with
this, they may provide something else.

In some cases, the hosting company will provide
you with the means to rebuild the database on your
own machine by downloading the database.

There's always a way. Always.

Of course, the way that the manual suggests is the
ideal way. The way that they suggest is by using the
mysql client.

A client is software that interacts with a server.
In this case, the mysql client interacts with
the MySQL server.

Notice that mysql is spelled in all lowercase
when it refers to the mysql client. This is
to differentiate is from the entire MySQL database
product which is spelled MySQL.

One thing you might want to be aware of in the
tutorial is batch mode:

Using mysql in Batch Mode

If you are not able to connect to the server
from your own computer, you may be able to
get a copy of the batch commands that will
re-generate the database on your machine.

Some web hosting commands provide a snapshot
of the database as a series of batch commands
that you can copy and paste from their MySQL
administrative area. Just log into your account
and copy and paste.

The above write-up on using mysql in batch
mode
should allow you to look at the database
under your locally installed version of MySQL.
Just feed these batch commands to mysql as the
above manual page describes.

I've not tried all of this yet but this seems to me
to be a reasonable way to do things.

Ed Abbott

Friday, July 16, 2010

The MySQL Tutorial

 
Recently, I've been learning
MySQL. For this reason, I'm
starting this blog. This is
the first post.

The best way to Learn MySQL?
MySQL comes with documentation.
I've been using the MySQL documentation
to learn MySQL.

Of course, documentation is not
always the best way to learn
something new. Most of us need
an easy entry point.

The easy entry point in the
documentation is found in chapter
3. This is where the MySQL tutorial
for beginner's is found. It is
here, in Chapter 3 of the MySQL 5.1
Reference Manual
:

Chapter 3. Tutorial

Chapter 3 of the MySQL 5.1 Reference
Manual
consists of nothing but a
beginner's tutorial. It is excellent!
It gives all kinds of hints and examples
to help you get started.

For this reason, I think of it as
The MySQL Tutorial. In a
sense, it is. It is the official
MySQL tutorial.

Based on what I've seen so far, this
is an excellent starting place if
your desire is to learn MySQL.

There's a basic principle here. If
you want good information, get as
close as possible to the original
fountainhead for that information.
The closer, the better.

In this case, the fountainhead is
the people who provide MySQL to the
rest of us. You can't get any closer
than that.

Ed Abbott