Membuat Database MYSQL di XAMPP menggunakan CMD

KUSNADI 87
31 Oct 202218:08

Summary

TLDRThis tutorial demonstrates how to create a MySQL database using the command prompt in XAMPP. The video walks viewers through the entire process, from installing XAMPP to using commands like 'create database', 'create table', and 'insert' to manage data. It covers essential operations such as displaying tables, updating, deleting data, and even dropping a database. Ideal for beginners, it provides a clear, step-by-step guide on managing databases with MySQL in a local server environment using CMD.

Takeaways

  • 😀 Make sure you have XAMPP (or similar) installed on your computer to work with MySQL databases through the command prompt.
  • 😀 You can open XAMPP's control panel, but you only need to run MySQL, not Apache, to create and manage databases.
  • 😀 To access MySQL through the command prompt, navigate to your XAMPP installation folder and use the command 'mysql -u root'.
  • 😀 The latest versions of MySQL have been replaced by MariaDB, so you will see 'MariaDB' instead of 'MySQL' in newer XAMPP versions.
  • 😀 Use the 'SHOW DATABASES;' command to view existing databases in MySQL/MariaDB.
  • 😀 To create a new database, use the command 'CREATE DATABASE <database_name>;' followed by 'SHOW DATABASES;' to verify creation.
  • 😀 Once the database is created, use the 'USE <database_name>;' command to start working within that database.
  • 😀 To create tables within your database, use the 'CREATE TABLE <table_name> (...);' command and define the columns and their data types.
  • 😀 To insert data into a table, use the 'INSERT INTO <table_name> (columns) VALUES (...);' command with the appropriate values.
  • 😀 You can update data in the table using the 'UPDATE <table_name> SET column = value WHERE condition;' command.
  • 😀 To delete specific data, use the 'DELETE FROM <table_name> WHERE condition;' command. To remove an entire database, use 'DROP DATABASE <database_name>;'

Q & A

  • What is the purpose of this tutorial?

    -The tutorial demonstrates how to create a MySQL database using the command prompt (CMD) in XAMPP.

  • What software do I need to have installed before starting the process?

    -You need to have XAMPP installed on your computer. This software package includes MySQL, Apache, and other necessary components for web development.

  • How do I start MySQL in XAMPP?

    -To start MySQL in XAMPP, open the XAMPP Control Panel and start MySQL. You don’t need to start Apache unless you want to run a web server.

  • How do I open MySQL using the command prompt?

    -Navigate to the XAMPP directory (e.g., `C:/xampp/`), then to the `mysql/bin/` folder using the `cd` command. After that, run the `mysql -u root` command to enter the MySQL prompt.

  • What is the purpose of the `show databases` command?

    -The `show databases` command lists all the existing databases in MySQL, allowing you to see which databases are available on your system.

  • What command is used to create a new database in MySQL?

    -The command used to create a new database is `CREATE DATABASE` followed by the database name. For example, `CREATE DATABASE studentDB;`.

  • What does the `USE` command do in MySQL?

    -The `USE` command selects a specific database to work with. Once executed, all further operations will be performed on the selected database.

  • How do you create a table in MySQL?

    -To create a table, you use the `CREATE TABLE` command followed by the table name and the column definitions. For example, `CREATE TABLE student_data (NISN INT(4) NOT NULL, name VARCHAR(50), ...);`.

  • What does the `INSERT INTO` command do in MySQL?

    -The `INSERT INTO` command is used to add data into a table. For example, `INSERT INTO student_data (NISN, name, class, address) VALUES (101, 'Naura', '2PGL1', 'Pamekasan');`.

  • How can you modify an existing record in MySQL?

    -You can modify a record using the `UPDATE` command. For example, `UPDATE student_data SET name = 'Naura Safarani' WHERE NISN = 101;` will change the name of the student with NISN 101.

  • How do you delete a record in MySQL?

    -To delete a record, you use the `DELETE` command with a `WHERE` clause. For example, `DELETE FROM student_data WHERE NISN = 101;` will remove the student with NISN 101.

  • What happens if you use the `DROP DATABASE` command?

    -The `DROP DATABASE` command completely deletes a database and all its associated tables. For example, `DROP DATABASE studentDB;` will remove the `studentDB` database from MySQL.

Outlines

plate

Cette section est réservée aux utilisateurs payants. Améliorez votre compte pour accéder à cette section.

Améliorer maintenant

Mindmap

plate

Cette section est réservée aux utilisateurs payants. Améliorez votre compte pour accéder à cette section.

Améliorer maintenant

Keywords

plate

Cette section est réservée aux utilisateurs payants. Améliorez votre compte pour accéder à cette section.

Améliorer maintenant

Highlights

plate

Cette section est réservée aux utilisateurs payants. Améliorez votre compte pour accéder à cette section.

Améliorer maintenant

Transcripts

plate

Cette section est réservée aux utilisateurs payants. Améliorez votre compte pour accéder à cette section.

Améliorer maintenant
Rate This

5.0 / 5 (0 votes)

Étiquettes Connexes
MySQL TutorialXAMPP SetupDatabase CreationCMD CommandsTech TutorialBeginner GuideMariaDBDatabase ManagementWeb DevelopmentProgrammingXAMPP Control
Besoin d'un résumé en anglais ?