Execute MySQL query using command prompt

6,731 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
6,731
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
30
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Execute MySQL query using command prompt

  1. 1. Y! : ikhwankrisnadi GTalk: krisnadiikhwanEXECUTE MYSQL QUERYUSING COMMANDPROMPTPREPARED BY: IKHWAN KRISNADI –SOFTWARE ENGINEER
  2. 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. 3. Y! : ikhwankrisnadi GTalk: krisnadiikhwanSTEPS Prepare MySQL query file For example, add “student” table into “test”
  4. 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. 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. 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. 7. STEPS (CONTINUED) Open phpmyadmin using browser, to check it Y! : ikhwankrisnadi GTalk: krisnadiikhwan
  8. 8. STEPS (CONTINUED) Structure of “student” table Y! : ikhwankrisnadi GTalk: krisnadiikhwan
  9. 9. STEPS (CONTINUED) Already add “student” table into “test” database successfully Y! : ikhwankrisnadi GTalk: krisnadiikhwan
  10. 10. THANK YOUY! : ikhwankrisnadi GTalk: krisnadiikhwan

×