This document provides steps for installing MySQL on Windows systems. It outlines downloading and running the MySQL installer, selecting a typical setup, and completing the installation. It also describes how to start MySQL, create an admin account, run basic SQL commands to view databases and create/insert/select from tables. Testing the MySQL installation with PHP functions is presented.
4. Installing MySQL on Windows Mike Barras (m.barras@its.utexas.edu) Installing MySQL Step 1: Download the most recent version of the MySQL for Windows installer from http://www.mysql.org/ , and run it. Select the directory to which you would like to install MySQL (c:ysql).
5.
6. Installing MySQL on Windows Mike Barras (m.barras@its.utexas.edu) Installing MySQL Step 3: That’s it! Click finish and you’re done installing (it really is just that simple)
7. Installing MySQL on Windows Mike Barras (m.barras@its.utexas.edu) Running MySQL You must manually start MySQL the first time. c:ysqlininmysqladmin.exe You will be prompted to create an admin username and Password. This is the login information for the admin tool, not any specific database or table. Once the admin account is created, the server will be running (either as a program in Win 9x or as a service in NT) and will run each time you start Windows. The “traffic light” system tray icon shows you its working.
8. Installing MySQL on Windows Mike Barras (m.barras@its.utexas.edu) Running MySQL Run the MySQL command interface by executing c:ysqlinysql.exe Type show databases; to See the current databases Configured on the server. By default, “mysql” and “ test” should be there. Type use test; to specify that database.
9. Installing MySQL on Windows Mike Barras (m.barras@its.utexas.edu) Running MySQL Let’s create a table. Type show tables; to see Currently defined tables in “ test”. Issue create table command to create a table. Now run show tables; again to verify what you’ve done. create table tablename ( column datatype );
10. Installing MySQL on Windows Mike Barras (m.barras@its.utexas.edu) Running MySQL Insert some data into the table you’ve just created using the “insert into” SQL command. Verify the insert by “selecting” the information back out. insert into tablename ( field1, field2,… ) values ( value1, value2,… ); select [list of fieldnames or *] from tablename;
11. Installing MySQL on Windows Mike Barras (m.barras@its.utexas.edu) Testing with PHP The true measure of success (requires PHP and web server) Put it all together. PHP Functions: mysql_connect( host[,user,pass] ) mysql_select_db( database ) mysql_query( SQL stmt ); mysql_close( database handle );
12. Installing MySQL on Windows Mike Barras (m.barras@its.utexas.edu) Testing with PHP
13. Installing PHP on Windows Useful Links This Presentation http:// uts.cc.utexas.edu/~mpbarras/php / Download MySQL http://www.mysql.com/downloads/mysql-4.0.html Installation Documentation http://www.mysql.com/documentation/index.html PHP reference for MySQL functions http://www.php.net/manual/en/ref.mysql.php Mike Barras (m.barras@its.utexas.edu)