hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Using the MySQL command line
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

Using the MySQL command line

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 07-07-2005, 01:59 PM
UrlGuy UrlGuy is offline
Aspiring Evangelist
 
Join Date: Feb 2005
Location: Norway
Posts: 391

Using the MySQL command line


Hi,

I'm starting to learn using the MySQL command line now..
Its in c:\Webroot\MySql\bin\mysql.exe .
First I do
> mysql -u root -p
asks me for password and I enter it.
Then I do "show databases;"
gives me a row of different databases.
Lets say I chose one of them named food with 'use food;'
then I used 'show tables;'
got a list.. of 1000s of different kinds of food.
Then I used 'SELECT * FROM pizza;'
and this showed me a huge list of pizza's.
As this were really hard to read, is there anyway I can output this result of all the pizzas I got into a textfile or similar?
Hope anyone can help, thanks for reading.

Reply With Quote


Sponsored Links
  #2  
Old 07-07-2005, 02:18 PM
fastduke fastduke is offline
WHT Addict
 
Join Date: Dec 2003
Location: Earth
Posts: 144
Code:
SELECT * INTO OUTFILE 'somepath\somefilename.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM pizza;

__________________
if($php !== $javascript){
echo "Good it's not supposed to be";
}

Reply With Quote
  #3  
Old 07-12-2005, 11:05 PM
Glosk Glosk is offline
Newbie
 
Join Date: Jul 2005
Posts: 9
Hi

You can also set mysql to output to a file using \T option like

mysql> \T c:\log.txt

To stop loggin, just do

mysql> \t


Hopes this helps

Glosk

Reply With Quote
Sponsored Links
Reply

Related posts from TheWhir.com
Title Type Date Posted
Web Host eApps Offers Control Panel ISPmanager for Free Web Hosting News 2011-12-07 21:48:20
Web Host Rackspace Launches Private Beta for MySQL Cloud Database Web Hosting News 2011-12-01 21:09:51
Parallels Now Offering Licenses for CloudLinux OS Web Hosting News 2011-10-26 17:29:25
Web Host FireHost Partners with Cloud Security Firm Gazzang for Data Encryption Web Hosting News 2011-08-16 20:33:43
Gazzang Data Encrytion Solution Adds Support for CloudLinux Platform Web Hosting News 2011-06-30 18:54:10


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?