MySQL create database
This tutorial demonstrates the process of creating MySQL database.
Tutorial info:
| Name: | MySQL create database |
| Total steps: | 1 |
| Category: | MySQL |
| Date: | 2009-04-22 |
| Level: | Beginner |
| Product: | See complete product |
| Viewed: | 15403 |
Bookmark MySQL create database
Step 1 - MySQL create database
MySQL create database
Introduction
To create a MySQL database you need the MySQL server already installed. You can create more databases in one MySQL server and you can add more tables to one MySQL database. One database should collect the tables for one special topic as for example all data relevant for a website.
Creating the database
Creating MySQL database is quite straightforward. After you have connected to the MySQL server simply use the CREATE DATABASE command followed by the requested database name:
Code:CREATE DATABASE mydb;
If you get an "Access denied" error message it means that you have not enough permissions. Only users with the "create" permission can create a new database.
Using the database
Successfully creating a MySQL database doesn't mean that you can use it immediately. Before you can create tables in your newly created database you first need to tell the MySQL server which database you want to use. You can do it with the "USE" command in the following way:
Code:USE mydb;
As you can see database creation is not complicated, the hard work comes later.
Tags: mysql create database, create database, mysal database, mysql, create, database
| MySQL create database - Table of contents |
|---|
| Step 1 - MySQL create database |