If Your Web Host Provides PHP and MySQL
If the host that provides you with Web space has already installed andset 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 user name 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 interfering 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, both, or neither
of these methods, so you'll need to ask.If your host allows you to log in by telnet or SSH to do your work,
you'll need a user name 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 book
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 MySQLGUI.
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.Many less expensive Web hosts these days support neither telnet/SSH
access, nor direct access to their MySQL servers. Instead, they normally provide
a management console that allows you to browse and edit your database through
your Web browser (though some actually expect you to install one yourself,
which I'll cover briefly in "Getting Started with MySQL"). Although
this is a fairly convenient and not overly restrictive solution, it doesn't
help you learn. Instead, I'd recommend you install a MySQL server on your
own system to experiment with, 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 the Web-based management console. See the previous
sections for instructions on installing MySQL under Windows, Linux, and Mac
OS X.