Friday, February 5, 2010

WAMP: MySQL



The debate was between whether or not MySQL when installed from WAMP would work on Server 2003 with SQL Server 2005 installed. The concern was that with the IIS already running that Apache would have a conflict. I installed WAMP. The WAMP notification icon was yellow indicating that one service was running. When I tried to start all services I received an error.
I was able to access MySQL, create add records to a table I created in a database I created.

Follow these instructions modifying names with your own.

Click on the MySQL console in WAMP Server.
When promted for a password hit enter (password is blank).
To Create a Database
type:
CREATE DATABASE database_name

To create a Table
type:
USE database_name; Create Table table_name (column_one text NOT NULL, column_two text NOT NULL, column_ID int(5) NOT NULL default '0' , PRIMARY KEY (column_ID) ) TYPE=MyISAM;

To add records to the Table
type:
USE database_name; Insert into table_name (column_one, column_two, column_ID) values ("value1", "value2", value3);

To display specific columns
type: USE database_name; Select column_one, column_two From table_name;

I learned how to create a database in MySQL from the MySQL Manual.
I learned how to create a table in MySQL from netadmintools.com.
I learned how to add records to a table from webdevelopersnotes.com

No comments: