IT Community - Software Programming, Web Development and Technical Support

Some tips of using Mysql Commands in Command Line

This is a discussion on Some tips of using Mysql Commands in Command Line within the Database Support forums, part of the Web Development category; Hi, Here are some tips of using MYSQL Commands in Command Prompt. Executing Commands from Outside MYSQL in Command Prompt. ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Database Support

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 07-05-2007, 11:09 AM
Murali Murali is offline
D-Web Master
 
Join Date: Feb 2007
Location: India-Chennai.
Posts: 385
Murali is on a distinguished road
Send a message via AIM to Murali
Default Some tips of using Mysql Commands in Command Line

Hi,

Here are some tips of using MYSQL Commands in Command Prompt.
Executing Commands from Outside MYSQL in Command Prompt.


For Creating Database

DB@server:/> mysql -u root -e "DROP DATABASE test1";

For Executing any Queries

DB@server:/> mysql -u root -e "SELECT * FROM TABLENAME" dbname;

Export the Record set of the Table into XML/HTML

DB@server:/> mysql -u root -X -e "SELECT * FROM TABLENAME" dbname;
DB@server:/> mysql -u root -H -e "SELECT * FROM TABLENAME" dbname;

-X --> Exports the Record set into XML Form.
-H --> Exports the Record set into HTML Form.

The Output Can be saved to a particular path by specifying the path.

DB@server:/> mysql -u root -X -e "SELECT * FROM TABLENAME" dbname > (Destination File Path);
DB@server:/> mysql -u root -H -e "SELECT * FROM TABLENAME" dbname > (Destination File Path);
__________________
-Murali..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I execute a PHP script using command line? sundarraja PHP Programming 0 01-28-2008 01:53 AM
Using PHP from Command Line Sabari PHP Programming 4 12-18-2007 05:42 AM
How can we use AT commands in j2me? means how can we pass an AT command one phone to mobilegeek J2ME 1 11-10-2007 01:35 AM
How do I run a php script from the command line itbarota PHP Programming 1 09-11-2007 02:06 AM
How do I access command-line arguments? prasath C and C++ Programming 1 08-17-2007 10:46 PM


All times are GMT -7. The time now is 07:32 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0