You are on page 1of 4

Microsoft Windows [Version 10.0.

10586]

(c) 2016 Microsoft Corporation. All rights reserved.

C:\Users\U53R>cd../../

C:\>cd xampp

C:\xampp>cd mysql

C:\xampp\mysql>cd bin

C:\xampp\mysql\bin>mysql -u root -p

Enter password:

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

Your MySQL connection id is 3

Server version: 5.6.20 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

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

mysql>

mysql> create database db_kampus;


Query OK, 1 row affected (0.01 sec)

mysql> usedb_kampus

-> ;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'usedb_kampus' at line 1

mysql> use db_kampus;

Database changed

mysql> use kampus;

ERROR 1049 (42000): Unknown database 'kampus'

mysql> create table unusra(

-> nama varchar(35),

-> nim varchar(10),

-> no_hp int(12));

Query OK, 0 rows affected (0.25 sec)

mysql> show tables;

+---------------------+

| Tables_in_db_kampus |

+---------------------+

| unusra |

+---------------------+

1 row in set (0.00 sec)

mysql> create database rate_rate(

-> nama varchar(15),

-> nim varchar(12));


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near '(

nama varchar(15),

nim varchar(12))' at line 1

mysql> create database rate_rate(

-> nama varchar(15),

-> nim varchar(12),

-> no_hp int(12));

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near '(

nama varchar(15),

nim varchar(12),

no_hp int(12))' at line 1

mysql> create table rate_rate(

-> nama varchar(15),

-> nim varchar(12));

Query OK, 0 rows affected (0.28 sec)

mysql> show tables;

+---------------------+

| Tables_in_db_kampus |

+---------------------+

| rate_rate |

| unusra |

+---------------------+

2 rows in set (0.00 sec)

mysql> desc unusra;


+-------+-------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+-------+-------------+------+-----+---------+-------+

| nama | varchar(35) | YES | | NULL | |

| nim | varchar(10) | YES | | NULL | |

| no_hp | int(12) | YES | | NULL | |

+-------+-------------+------+-----+---------+-------+

3 rows in set (0.08 sec)

mysql> desc rate_rate;

+-------+-------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+-------+-------------+------+-----+---------+-------+

| nama | varchar(15) | YES | | NULL | |

| nim | varchar(12) | YES | | NULL | |

+-------+-------------+------+-----+---------+-------+

2 rows in set (0.02 sec)

mysql>

You might also like