0% found this document useful (0 votes)
103 views

Xampp

The document shows the steps of connecting to a MariaDB database server using the mysql command line client. It creates a new database called latihan2, creates a sample table, inserts and deletes a record from the table, and finally drops the latihan2 database.

Uploaded by

Aria Palsu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views

Xampp

The document shows the steps of connecting to a MariaDB database server using the mysql command line client. It creates a new database called latihan2, creates a sample table, inserts and deletes a record from the table, and finally drops the latihan2 database.

Uploaded by

Aria Palsu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Microsoft Windows [Version 10.0.19042.

1415]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Asus>cd c:/xampp/mysql/bin

c:\xampp\mysql\bin>mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 10.4.21-MariaDB mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]> show databases;


+--------------------+
| Database |
+--------------------+
| information_schema |
| latihan1 |
| mysql |
| performance_schema |
| perpustakaan |
| phpmyadmin |
| test |
+--------------------+
7 rows in set (0.001 sec)

MariaDB [(none)]> create database latihan2;


Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> use latihan2;


Database changed
MariaDB [latihan2]> create table contoh (
-> Nama varchar(50) not null primary key,
-> Nomor char(10)
-> );
Query OK, 0 rows affected (0.270 sec)

MariaDB [latihan2]> desc contoh;


+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| Nama | varchar(50) | NO | PRI | NULL | |
| Nomor | char(10) | YES | | NULL | |
+-------+-------------+------+-----+---------+-------+
2 rows in set (0.010 sec)

MariaDB [latihan2]> insert into contoh values ('Aria','04');


Query OK, 1 row affected (0.075 sec)

MariaDB [latihan2]> select * from contoh;


+------+-------+
| Nama | Nomor |
+------+-------+
| Aria | 04 |
+------+-------+
1 row in set (0.000 sec)
MariaDB [latihan2]> delete from contoh Nama ="Aria";
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near 'Nama
="Aria"' at line 1
MariaDB [latihan2]> delete from contoh where Nama ="Aria";
Query OK, 1 row affected (0.057 sec)

MariaDB [latihan2]> select * from contoh;


Empty set (0.000 sec)

MariaDB [latihan2]> drop database latihan2;


Query OK, 1 row affected (0.196 sec)

MariaDB [(none)]> show databases;


+--------------------+
| Database |
+--------------------+
| information_schema |
| latihan1 |
| mysql |
| performance_schema |
| perpustakaan |
| phpmyadmin |
| test |
+--------------------+
7 rows in set (0.001 sec)

MariaDB [(none)]>

You might also like