Datasheet

14
Part I: Developing a Web Database Application Using PHP and MySQL
It supports large databases. MySQL handles databases up to 50 million
rows or more. The default file size limit for a table is 4GB, but you can
increase this (if your operating system can handle it) to a theoretical
limit of 8 million terabytes (TB).
It’s customizable. The open source GPL license allows programmers to
modify the MySQL software to fit their own specific environments.
How MySQL works
The MySQL software consists of the MySQL server, several utility programs
that assist in the administration of MySQL databases, and some supporting
software that the MySQL server needs (but you don’t need to know about).
The heart of the system is the MySQL server.
The MySQL server is the manager of the database system. It handles all your
database instructions. For instance, if you want to create a new database, you
send a message to the MySQL server that says “create a new database and
call it newdata.” The MySQL server then creates a subdirectory in its data
directory, names the new subdirectory newdata, and puts the necessary
files with the required format into the newdata subdirectory. In the same
manner, to add data to that database, you send a message to the MySQL
server, giving it the data and telling it where you want the data to be added.
You find out how to write and send messages to MySQL in Part II.
Before you can pass instructions to the MySQL server, it must be running
and waiting for requests. The MySQL server is usually set up so that it starts
when the computer starts and continues running all the time. This is the
usual setup for a Web site. However, it’s not necessary to set it up to start
when the computer starts. If you need to, you can start it manually whenever
you want to access a database. When it’s running, the MySQL server listens
continuously for messages that are directed to it.
Communicating with the MySQL server
All your interaction with the database is accomplished by passing messages
to the MySQL server. You can send messages to the MySQL server several
ways, but this book focuses on sending messages using PHP. The PHP soft-
ware has specific statements that you use to send instructions to the MySQL
server.
The MySQL server must be able to understand the instructions that you send
it. You communicate by using SQL (Structured Query Language), which is a
standard language understood by many RDBMSs. The MySQL server under-
stands SQL. PHP doesn’t understand SQL, but it doesn’t need to: PHP just
establishes a connection with the MySQL server and sends the SQL message
05_527580-ch01.indd 1405_527580-ch01.indd 14 11/3/09 8:50 PM11/3/09 8:50 PM