![Page 1: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/1.jpg)
1
Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002Service Pack 2
Download and Install
MySQLmysql-noinstall-5.0.51b-win32.ziphttp://dev.mysql.com/
MySQL GUI Toolsmysql-gui-tools-noinstall-5.0-r12-win32.ziphttp://dev.mysql.com/
Unzip both directly to the root drive using the folder names. This should create thefollowing:
C:\mysql-5.0.51b-win32
C:\MySQL GUI Tools 5.0
![Page 2: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/2.jpg)
2
Create Environment Variables
Create an environment variable called MYSQL_HOME and point to where MySQL isinstalled. The default location is:
C:\mysql-5.0.51b-win32
Update the PATH variable to include %MYSQL_HOME%\bin.
![Page 3: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/3.jpg)
3
Start the MySQL Server
You can also create a Shortcut on your Desktop to make this easier.
Open a cmd prompt.
Enter the following command to install MySQL as a service:
mysqld-nt --install
![Page 4: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/4.jpg)
4
If you have errors, try renaming the MySQL folder to:
C:\mysql
Update the MYSQL_HOME environment variable.
If you are still have errors, try to start MySQL with the following:
Open a cmd prompt.
Enter the following command to install MySQL as a service:
mysqld-nt --console
![Page 5: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/5.jpg)
5
Enter the following command to start the service:
net start mysql
![Page 6: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/6.jpg)
6
To stop MySQL and remove the service:
Enter the following command to stop the service:
net stop mysql
![Page 7: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/7.jpg)
7
Enter the following command to remove the service:
mysqld-nt -- remove
![Page 8: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/8.jpg)
8
Start MySQL Query Browser
You can also create a Shortcut on your Desktop to make this easier.
Run the following command:
C:\MySQL GUI Tools 5.0\MySQLQueryBrowser.exe
Enter train for the Default Schema and leave the Passowrd blank. This is the defaultpassword for root:
Click OK and you will be prompted to create the Schema.
![Page 9: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/9.jpg)
9
You should see the following.
![Page 10: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/10.jpg)
10
Change Options
Select Tools | Options…
![Page 11: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/11.jpg)
11
Data Definition Language (DDL)
CREATE TABLE
Enter the following:
-- Create Table pet
CREATE TABLE pet(id INTEGER NOT NULL PRIMARY KEY,name VARCHAR(35),price DECIMAL(5,2),birth_date DATE);
![Page 12: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/12.jpg)
12
Execute the Script.
Select the Script, then Select Script | Execute Selection
You should see the table in the Schemata View.
![Page 13: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/13.jpg)
13
Data Manipulation Language (DML)
INSERT
Enter the following:
-- Insert a row into petINSERT INTO pet(id,name,price,birth_date)VALUES(1,'Fido',125.99,'2005-10-10');
Execute the Script.
Select the Script, then Select Script | Execute Selection
![Page 14: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/14.jpg)
14
SELECT
Create a Resultset Tab by selecting File | New Resultset Tab
Enter the following in the Query View:
-- Select the rows from petSELECT * FROM pet;
![Page 15: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/15.jpg)
15
Execute the Script.
You should see the following.
![Page 16: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/16.jpg)
16
Data Control Language (DCL)
First, create a new user.
-- Create userCREATE USER 'user1'@'localhost'IDENTIFIED BY 'pass1';
GRANT
Enter the following:
-- Grant privilegeGRANT SELECT,INSERTON TABLE petTO 'user1'@'localhost';
![Page 17: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/17.jpg)
17
Execute the Script.
Select the Script, then Select Script | Execute Selection
![Page 18: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/18.jpg)
18
Save the Script
Select File | Save As…
![Page 19: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/19.jpg)
19
Name the file.
![Page 20: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/20.jpg)
20
Test the GRANT
Close the MySQL Query Browser and reopen.
Login with user1 and pass1
![Page 21: MySQL and Query Browser Quick Start and Query... · 1 Using MySQL and MySQL GUI Tools on Windows XP Professional Version 2002 Service Pack 2 Download and Install MySQL mysql-noinstall-5.0.51b-win32.zip](https://reader031.vdocuments.net/reader031/viewer/2022022605/5b6df5947f8b9a0d578da45f/html5/thumbnails/21.jpg)
21
Enter the following and Execute the Script. The DROP should not be allowed.
-- Drop Table petDROP TABLE pet;