my sql

13
1 Installing MySQL on Windows Mike Barras ([email protected]) Introduction 1.Introduction 2. Installing MySQL 3.Running MySQL 4. Testing with PHP Presented by Mike Barras, ITS Available online at http:// uts.cc.utexas.edu/~mpbarras/php /

Upload: ramasubbu-p

Post on 17-May-2015

1.897 views

Category:

Education


3 download

DESCRIPTION

Presentation

TRANSCRIPT

Page 1: My SQl

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/

Page 2: My SQl

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

Page 3: My SQl

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.

Page 4: My SQl

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).

Page 5: My SQl

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

Page 6: My SQl

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)

Page 7: My SQl

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.

Page 8: My SQl

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.

Page 9: My SQl

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);

Page 10: My SQl

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;

Page 11: My SQl

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);

Page 12: My SQl

12

Installing MySQL on Windows

Mike Barras ([email protected])

Testing with PHP

Page 13: My SQl

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])