If the host that provides you with Web space has already
installed and set up MySQL and PHP for you and you just want to
learn how to use them, there really isn't a lot you need to do.
Now would be a good time to get in touch with your host and
request any information you may need to access these services.
Specifically, you'll need a username and password to access the
MySQL server they've set up for you. They'll probably have
provided an empty database for you to use as well (which prevents
you from messing with the databases of other users who share the
same MySQL server), and you'll want to know the name of your
database.
There are two ways you can access the MySQL server directly.
Firstly, you can use telnet or secure shell (SSH) to log in to
the host. You can then use the MySQL client programs
(mysql, mysqladmin,
mysqldump) installed there to interact with the
MySQL server directly. The second method is to install those
client programs onto your own computer, and have them connect to
the MySQL server. Your Web host may support one or both of these
methods, so you'll need to ask which.
If your host allows you to log in by telnet or SSH to do your
work, you'll need a username and password for the login, in
addition to those you'll use to access the MySQL server (they can
be different). Be sure to ask for both sets of information.
If they support remote access to the MySQL server, you'll want to
download a program that lets you connect to, and interact with,
the server. This article series assumes you've downloaded from
http://www.mysql.com/ a binary
distribution of MySQL that includes the three client programs
(mysql, mysqladmin, and
mysqldump). Free packages are available for Windows,
Linux and other operating systems. Installation basically
consists of finding the three programs and putting them in a
convenient place. The rest of the package, which includes the
MySQL server, can be freely discarded. If you prefer a more
graphical interface, download something like MySQL GUI (also
available from
http://www.mysql.com). I'd really recommend getting
comfortable with the basic client programs first, though, as the
commands you use with them will be similar to those you'll
include in your PHP scripts to access MySQL databases.
Some less expensive Web hosts these days support neither
telnet/SSH access, nor direct access to their MySQL servers.
Instead, they provide a management console that allows you to
browse and edit your database through your Web browser. Although
this is a fairly convenient and not overly restrictive solution,
it doesn't help you learn. Instead, I'd recommend the
installation of a MySQL server on your own system to help,
especially in the next chapter. Once you're comfortable working
with your learning server, you can start using the server
provided by your Web host with their management console. See the
previous sections for instructions on installing MySQL under
Windows and Linux.