my sql
DESCRIPTION
PresentationTRANSCRIPT
1
Installing MySQL on Windows
Mike Barras ([email protected])
Introduction
1. Introduction2. Installing MySQL3. Running MySQL4. Testing with PHP
Presented by Mike Barras, ITS
Available online athttp://uts.cc.utexas.edu/~mpbarras/php/
2
Installing MySQL on Windows
Mike Barras ([email protected])
Introduction
Supported 32-bit Windows Platforms (Win32)
Windows 9x (95/98/ME) Windows NT (NT/2000/XP)
Workstation/Home/ProfessionalServer Editions
3
Installing MySQL on Windows
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 on Windows
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 directoryto which you would like to install MySQL(c:\mysql).
5
Installing MySQL on Windows
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 on Windows
Mike Barras ([email protected])
Installing MySQL
Step 3: That’s it! Click finish and you’re done installing (it reallyis just that simple)
7
Installing MySQL on Windows
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” systemtray icon shows you its working.
8
Installing MySQL on Windows
Mike Barras ([email protected])
Running MySQL
Run the MySQL command interface by executing c:\mysql\bin\mysql.exe
Type show databases; toSee the current databasesConfigured on the server.By default, “mysql” and“test” should be there.
Type use test; to specifythat database.
9
Installing MySQL on Windows
Mike Barras ([email protected])
Running MySQL
Let’s create a table.
Type show tables; to seeCurrently defined tables in“test”.
Issue create table commandto 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 ([email protected])
Running MySQL
Insert some data into the table you’ve just createdusing the “insert into” SQLcommand.
Verify the insert by “selecting” the information backout.
insert into tablename (field1, field2,…)values (value1, value2,…);
select [list of fieldnames or *]from tablename;
11
Installing MySQL on Windows
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);
13
Installing PHP on Windows
Useful Links
This Presentationhttp://uts.cc.utexas.edu/~mpbarras/php/
Download MySQLhttp://www.mysql.com/downloads/mysql-4.0.html
Installation Documentation http://www.mysql.com/documentation/index.html
PHP reference for MySQL functionshttp://www.php.net/manual/en/ref.mysql.php
Mike Barras ([email protected])