create database on Linux

Posted: Oktober 9, 2011 in database
Tag:

by Ade ‘surya’ Andrial

do not need a long winded sentence, linux terminal console is my passion forexploration and command words.
Now we will create a database from a linux terminal console, do not forget to phpmyadmin, mysql and apache it should already be installed within the operating system
and then…!!!
open a terminal for your linux dudz
Just follow the steps below ..

bekicot

Mysql on LInuX

root@harubirukill:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 65
Server version: 5.1.49-1ubuntu8.1 (Ubuntu)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> create database beasiswa;
Query OK, 1 row affected (0.00 sec)

mysql> use beasiswa;
Database changed

mysql> create table mahasiswa (
id_mhs int(100),
nama varchar(100),
alamat varchar(100),
tanggal date,
kelamin varchar(100),
primary key (id_mhs)
);

mysql> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| beasiswa           |
| cinta              |
| mysql              |
| phpmyadmin        |
| wordpress         |
+——————–+
6 rows in set (0.00 sec)

mysql> show tables;
+——————–+
| Tables_in_beasiswa |
+——————–+
| mahasiswa          |
+——————–+
1 row in set (0.00 sec)

mysql> desc mahasiswa;
+———+————–+——+—–+———+——-+
| Field   | Type         | Null | Key | Default | Extra |
+———+————–+——+—–+———+——-+
| id_mhs | int(100)     | NO   | PRI | 0     |     |
| nama   | varchar(100) | YES |     | NULL   |     |
| alamat  | varchar(100) | YES |     | NULL   |     |
| tanggal | date        | YES |     | NULL   |      |
| kelamin | varchar(100) | YES |    | NULL   |      |
+———+————–+——+—–+———+——-+
5 rows in set (0.00 sec)

hahah segitu dulu ya tutorial singkat nya
kalau mau buat table databasenya yang lain tinggal ikuti ajj dan tela’ah baik2.
😀

READ THE FUCKING MANUAL.

Komentar
  1. amad1717 mengatakan:

    wew mantap ne bg . .
    saya baru bljar database . .

  2. Arief Abdul Ghafur mengatakan:

    hadeh,,, TQ

  3. firdaus mengatakan:

    oa bang file db yang udah kita creat dimana letaknya file tersebut ?

  4. ophrack3rz mengatakan:

    amad oke gan sma sma ne

    firdaus, tergantung dimana disimpannya😀

  5. […] create database on Linux […]

  6. cikeuno mengatakan:

    wow… msh bingung..

  7. ophrack3rz mengatakan:

    belajar lagi gan😀
    itu insyaAllah udah dari awal tu bro

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s