Installing MySQL on Windows Mike Barras (m.barras@its.utexas.edu) Introduction Introduction Installing MySQL Running MySQL Testing with PHP Presented by Mike Barras, ITS Available online at http:// uts.cc.utexas.edu/~mpbarras/php /
Installing MySQL on Windows Mike Barras (m.barras@its.utexas.edu) Introduction Supported 32-bit Windows Platforms (Win32)  Windows 9x (95/98/ME) Windows NT (NT/2000/XP) Workstation/Home/Professional Server Editions
Installing MySQL on Windows Mike Barras (m.barras@its.utexas.edu) Installing MySQL Example environment Windows 2000 Server (SP 3) IIS 5.0 PHP 4.3.1 MySQL 4.0.12 Note: IIS (Web Server) and PHP (Script engine) are  NOT required to install or run MySQL.
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:\mysql).
Installing MySQL on Windows Mike Barras (m.barras@its.utexas.edu) Installing MySQL Step 2: Select the setup type that you would like to use. The  “ typical” should be sufficient for just about everybody. It  installs all items, including: The Mysql Servers Clients and maint. tools Documentation Examples and Libraries Grants tables and core files
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)
Installing MySQL on Windows Mike Barras (m.barras@its.utexas.edu) Running MySQL You must manually start MySQL the first time. c:\mysql\bin\winmysqladmin.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.
Installing MySQL on Windows Mike Barras (m.barras@its.utexas.edu) Running MySQL Run the MySQL command interface by executing  c:\mysql\bin\mysql.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.
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 );
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;
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 );
Installing MySQL on Windows Mike Barras (m.barras@its.utexas.edu) Testing with PHP
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)

My SQl

  • 1.
    Installing MySQL onWindows Mike Barras ([email protected]) Introduction Introduction Installing MySQL Running MySQL Testing with PHP Presented by Mike Barras, ITS Available online at http:// uts.cc.utexas.edu/~mpbarras/php /
  • 2.
    Installing MySQL onWindows Mike Barras ([email protected]) Introduction Supported 32-bit Windows Platforms (Win32) Windows 9x (95/98/ME) Windows NT (NT/2000/XP) Workstation/Home/Professional Server Editions
  • 3.
    Installing MySQL onWindows Mike Barras ([email protected]) Installing MySQL Example environment Windows 2000 Server (SP 3) IIS 5.0 PHP 4.3.1 MySQL 4.0.12 Note: IIS (Web Server) and PHP (Script engine) are NOT required to install or run MySQL.
  • 4.
    Installing MySQL onWindows Mike Barras ([email protected]) 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:\mysql).
  • 5.
    Installing MySQL onWindows Mike Barras ([email protected]) Installing MySQL Step 2: Select the setup type that you would like to use. The “ typical” should be sufficient for just about everybody. It installs all items, including: The Mysql Servers Clients and maint. tools Documentation Examples and Libraries Grants tables and core files
  • 6.
    Installing MySQL onWindows Mike Barras ([email protected]) Installing MySQL Step 3: That’s it! Click finish and you’re done installing (it really is just that simple)
  • 7.
    Installing MySQL onWindows Mike Barras ([email protected]) Running MySQL You must manually start MySQL the first time. c:\mysql\bin\winmysqladmin.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 onWindows Mike Barras ([email protected]) Running MySQL Run the MySQL command interface by executing c:\mysql\bin\mysql.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 onWindows Mike Barras ([email protected]) 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 onWindows Mike Barras ([email protected]) 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 onWindows Mike Barras ([email protected]) 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 onWindows Mike Barras ([email protected]) Testing with PHP
  • 13.
    Installing PHP onWindows 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 ([email protected])