Tuesday, January 27, 2009

How To Create Database In MySQL

A database is just a container for components called tables. A DBMS can have as many databases as needed for a given application.For the most part, you create a database when your application needs a place to store data.



The client tool contacts the local MySQL installation and returns a prompt as shown here:



Welcome to the MySQL monitor. Commands end with ; or ’g.

Your MySQL connection id is 139 to server version: 4.1.10a-nt

Type ’help;’ or ’’h’ for help. Type ’’c’ to clear the buffer.

mysql>




In our example, we want to create a new database called samples that will hold numerous tables all related to samples needed by some application. In the most basic form, the database is created with the following command:



mysql> create database samples;

Query OK, 1 row affected (0.00 sec)



nb : you can call mysql with the run menu and type mysql an click OK button as shown in picture below :



img