SlideShare une entreprise Scribd logo
1  sur  10
Y! : ikhwankrisnadi   GTalk: krisnadiikhwan




EXECUTE MYSQL QUERY
USING COMMAND
PROMPT
PREPARED BY: IKHWAN KRISNADI –
SOFTWARE ENGINEER
ENVIRONMENT
   Using XAMPP version 1.6.7 (included PHP
    and MySQL)
   PHP version 5.2.6
   MySQL version 5.0.51b
   Windows 7 Home as OS




          Y! : ikhwankrisnadi   GTalk: krisnadiikhwan
Y! : ikhwankrisnadi   GTalk: krisnadiikhwan

STEPS
   Prepare MySQL query file
   For example, add “student” table into “test”
STEPS (CONTINUED)
   Save the query with named “student.sql”
   Open phpmyadmin using browser. Check
    “student” table is not existed on “test”
    database




           Y! : ikhwankrisnadi   GTalk: krisnadiikhwan
STEPS (CONTINUED)
   Open command prompt
   Go to “MySQL” directory installation. For
    example, “MySQL” directory in
    C:xamppmysql.



   Go to bin directory



           Y! : ikhwankrisnadi   GTalk: krisnadiikhwan
STEPS (CONTINUED)
   Type below:
    mysql -u [user_name] -p [database_name] <
    [file path of mysql query]
   For example:
    mysql -u root –p test < “C:student.sql”


   Press enter


           Y! : ikhwankrisnadi   GTalk: krisnadiikhwan
STEPS (CONTINUED)
   Open phpmyadmin using browser, to check it




           Y! : ikhwankrisnadi   GTalk: krisnadiikhwan
STEPS (CONTINUED)
   Structure of “student” table




           Y! : ikhwankrisnadi   GTalk: krisnadiikhwan
STEPS (CONTINUED)
   Already add “student” table into “test”
    database successfully




           Y! : ikhwankrisnadi   GTalk: krisnadiikhwan
THANK YOU

Y! : ikhwankrisnadi   GTalk: krisnadiikhwan

Contenu connexe

En vedette

En vedette (13)

OOPS Characteristics (With Examples in PHP)
OOPS Characteristics (With Examples in PHP)OOPS Characteristics (With Examples in PHP)
OOPS Characteristics (With Examples in PHP)
 
Control Structures In Php 2
Control Structures In Php 2Control Structures In Php 2
Control Structures In Php 2
 
Htmltag.ppt
Htmltag.pptHtmltag.ppt
Htmltag.ppt
 
Arrays in PHP
Arrays in PHPArrays in PHP
Arrays in PHP
 
Designing an Agile Fast Data Architecture for Big Data Ecosystem using Logica...
Designing an Agile Fast Data Architecture for Big Data Ecosystem using Logica...Designing an Agile Fast Data Architecture for Big Data Ecosystem using Logica...
Designing an Agile Fast Data Architecture for Big Data Ecosystem using Logica...
 
What's new in PHP 7.1
What's new in PHP 7.1What's new in PHP 7.1
What's new in PHP 7.1
 
PHP
PHPPHP
PHP
 
PHP Comprehensive Overview
PHP Comprehensive OverviewPHP Comprehensive Overview
PHP Comprehensive Overview
 
SQLcl overview - A new Command Line Interface for Oracle Database
SQLcl overview - A new Command Line Interface for Oracle DatabaseSQLcl overview - A new Command Line Interface for Oracle Database
SQLcl overview - A new Command Line Interface for Oracle Database
 
Form Processing In Php
Form Processing In PhpForm Processing In Php
Form Processing In Php
 
PHP variables
PHP  variablesPHP  variables
PHP variables
 
State management
State managementState management
State management
 
Php forms
Php formsPhp forms
Php forms
 

Execute MySQL query using command prompt

  • 1. Y! : ikhwankrisnadi GTalk: krisnadiikhwan EXECUTE MYSQL QUERY USING COMMAND PROMPT PREPARED BY: IKHWAN KRISNADI – SOFTWARE ENGINEER
  • 2. ENVIRONMENT  Using XAMPP version 1.6.7 (included PHP and MySQL)  PHP version 5.2.6  MySQL version 5.0.51b  Windows 7 Home as OS Y! : ikhwankrisnadi GTalk: krisnadiikhwan
  • 3. Y! : ikhwankrisnadi GTalk: krisnadiikhwan STEPS  Prepare MySQL query file  For example, add “student” table into “test”
  • 4. STEPS (CONTINUED)  Save the query with named “student.sql”  Open phpmyadmin using browser. Check “student” table is not existed on “test” database Y! : ikhwankrisnadi GTalk: krisnadiikhwan
  • 5. STEPS (CONTINUED)  Open command prompt  Go to “MySQL” directory installation. For example, “MySQL” directory in C:xamppmysql.  Go to bin directory Y! : ikhwankrisnadi GTalk: krisnadiikhwan
  • 6. STEPS (CONTINUED)  Type below: mysql -u [user_name] -p [database_name] < [file path of mysql query]  For example: mysql -u root –p test < “C:student.sql”  Press enter Y! : ikhwankrisnadi GTalk: krisnadiikhwan
  • 7. STEPS (CONTINUED)  Open phpmyadmin using browser, to check it Y! : ikhwankrisnadi GTalk: krisnadiikhwan
  • 8. STEPS (CONTINUED)  Structure of “student” table Y! : ikhwankrisnadi GTalk: krisnadiikhwan
  • 9. STEPS (CONTINUED)  Already add “student” table into “test” database successfully Y! : ikhwankrisnadi GTalk: krisnadiikhwan
  • 10. THANK YOU Y! : ikhwankrisnadi GTalk: krisnadiikhwan