|
January 2004 Technical Tip – Getting Started with MySQL
MySQL is a popular DBMS, particularly for data driven web sites using
PHP (PHP stands for hypertext preprocessor and is used for server-side
scripting.) This month I will show you how to set up and use MySQL. (Note:
I am using Microsoft XP Home edition.)
Getting MySQL
- Although available as a single package, MySQL is often found bundled
with Apache webserver and PHP: I downloaded the trio as
minixampp-win32-1.2.zip from http://www.apachefriends.org/wampp-en.html
and unzipped minixampp-win32-1.2.zip into c:\minixampp
- Open a command prompt window by choosing Start > Programs >
Accessories > Command Prompt
- Go to the unzipped folder by typing cd\minixampp
- Configure the trio by executing the batch file
setup_xampp.bat
Starting the MySQL server
- Still within the command prompt window, and still within the
unzipped folder, execute the batch file mysql_start.bat
- Do not close the window while the MySQL server is running (you can
minimize it, but do not close it.)
Executing MySQL
- Open another command prompt window.
- Type cd\minixampp\mysql\bin and press Enter.
- Type mysql and press Enter.
- Note the MySQL prompt is mysql>
- MySQL commands can be entered over multiple lines. All commands must
end with a semicolon.
Some MySQL commands
- The following should be self-explanatory if you know SQL. If you
don't know SQL, then give us a call (a shameless plug!)
Stopping the MySQL server
- Open another command prompt window.
- Type cd\minixampp and press Enter.
- Type mysql_stop.bat and press Enter.
- You can now close all open Command Prompt windows.
Learning more
Looking ahead
- Be sure to check back next month when I will show you how to access
MySQL databases from Java!
Go to the articles index. Written
by Bill Qualls. Copyright © 2004 by Caliber Data Training
800.938.1222 |