# How to make a MySQL Database?



## billenium

Okay i have Ubuntu Linux, Apache, MySQL and PHP (LAMP) server... I can't figure out how to make a database! heh... I tried looking online, didn't find much. Can anyone help me?


----------



## Skie

There are several things that need to be done. First is create the database, then create and assign the user to the database with permissions, then create the tables within the database.

To start, open a terminal window and su as root. Then type "mysql" so you can login to mysql. 

Create the database:

create database mydatabase;

Create user:

grant all on mydatabase.* to [email protected] identified by "mypassword";

(If this will be a remove user, then use the IP address [email protected] or if the user will be connecting from multiple IP's, you can either type in each IP or use [email protected]% as a wildcard. If multiple IP's, you'll need to issue a grant all for each IP.)

Create tables

This will be your basic SQL. If you create the SQL in a text file, you can use the following from the command line: mysql -u username -p mydatabase < myfile.sql

That's the basics to get your started.


----------



## royax

Much easy is to use PHPMyAdmin to create tables on database.


----------



## Skie

royax said:


> Much easy is to use PHPMyAdmin to create tables on database.


PHPMyAdmin has limitations. While it works fine with small databases, it's basically useless with large ones.


----------



## Warzx

If Your Using A Host Like x10 Or 110mb, Theres PHPmyadmin (2nd To Easiest) Or Theres A icon On Many Simple Host That Says "Create MYSQL Database" :grin:

Why Not Post Your Web Hosting Provider? That'll Make Things Alot More Easy To Explain.


----------



## billenium

First my host is: localhost

and second i got it... many many months ago...

Did you check the post date? February?


----------



## Warzx

Oh..Um...Err..Sorry. Lol, Ill Start Paying Attention To That From Now On...

:4-dontkno Sorry.


----------

