Install IIS 6 + PHP5.2.5 + MySQL in WIN 2003 (PART2)

Today let's lean how to set MySQL.

1. Download MySQL5.0.51a from http://dev.mysql.com/downloads/mysql/5.0.html
2. Unzip it to your C: drive. Then click setup.exe
3. Select "typical" installation.-->standard configuration-->install as windows service-->set new root password (write it down somewhere, otherwise....)
4. Now you can see Mysql in C:\Program Files\MySQL
5. Want access the database? Go to start-->all programs-->MYSQL-->MySQL server 5.0-->MYSQL command line client.
6. Read MYSQL tutorial from this link http://webhelp.ucs.ed.ac.uk/services/mysql/example1-cli.php
7. Add C:\PHP to your path. From the Start menu, right click My Computer and select Properties. From the Advanced tab click the Environment Variables button. Under System Variable find Path and click Edit. At the end of what is already present in Variable Value add a semicolon (;) and then C:\PHP.
8. If you can see it, Then your are success set up MYSQL, simple !

C:\mysql\bin\mysql.exe --host=127.0.0.1 --user=mylogin --password=mypassword
--database=mydb1 --execute="SELECT * FROM mytable"
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.00 sec)

mysql> use test;
mysql> show tables;


use this code test again, It works!
echo "hello";
//

$user="root";
$password="Your password here";
$database="test";
mysql_connect("localhost:3306",$user,$password) or die( "Unable to connect to SQL server");
echo "
Databasese connected!
";
mysql_select_db($database) or die( "Unable to select database");
$query="CREATE TABLE contacts (id int(6) NOT NULL auto_increment,first varchar(15) NOT NULL,last varchar(15) NOT NULL,phone varchar(20) NOT NULL,mobile varchar(20) NOT NULL,fax varchar(20) NOT NULL,email varchar(30) NOT NULL,web varchar(30) NOT NULL,PRIMARY KEY (id),UNIQUE id (id),KEY id_2 (id))";
mysql_query($query);
mysql_close();

//phpinfo();





Now it's time to install PHPMYADMIN, Ha Ha

1. Download phpMyAdmin-2.11.4-all-languages.zip from
http://www.phpmyadmin.net/home_page/index.php

2. Unzip it to C:\Inetpub\wwwroot

3. Open browser to http://localhost/phpMyAdmin-2.11.4-all-languages/scripts/setup.php
There are help file there....

4. download it and save the config.inc.php to C:\Inetpub\wwwroot\phpMyAdmin-2.11.4-all-languages

5. Then you can access it from the link:
http://localhost/phpMyAdmin-2.11.4-all-languages/

Comments

Popular posts from this blog

FireFox 加速