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
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment