MySQL Command Line Help
I tend to use MySQL from the interactive command line shell quite a bit (SSH to your db server and type the command mysql to start). I noticed today that there is a pretty extensive built in help system in this command.
You can access it by typing help COMMAND, so for instance if you type help ALTER TABLE you get a quick reference for constructing an ALTER TABLE statement.
If you can't remember what command you want to use, then typing help contents is your friend. It will output:
For more information, type 'help item', where item is one of the following categories: Administration Column Types Data Definition Data Manipulation Functions Geographic features Transactions
So if your looking for that command that outputs all the columns in a table, but don't know what it's called, you might now try help administration and it will tell you:
For more information, type 'help item', where item is one of the following categories: ANALYZE BACKUP TABLE CHECK CHECKSUM CONSTRAINT CREATE USER DESCRIBE FLUSH QUERY CACHE GRANT TYPES MERGE RENAME USER REPAIR RESET SLAVE RESTORE SET GLOBAL SQL_SLAVE_SKIP_COUNTER SET PASSWORD SHOW SLAVE STATUS START SLAVE STOP SLAVE
Yes ofcourse the command to show the columns in a table is called DESCRIBE, and you can get the help for it by typing help DESCRIBE (you pretty much just run DESCRIBE tableName)
My only wish for this handy feature is that some of the help pages listed simple examples, and not just syntax.
add to del.icio.us
| Tags: mysql, documentation, help, command, describe, alter table
Trackbacks
Trackback Address: 584/165DF48EACB20CC14E51EE9A626EC67C
Comments
On 10/03/2006 at 3:29:48 PM EDT Pete wrote:
1
test comment.
On 11/12/2006 at 2:53:36 AM EST Ishraga Allam wrote:
2
Please I want to create a database in mysql prompt command . I want to use it in my php script language. I want to use an account, how can I do that... I keep getting Unknown Server Host 'what I write ' > mysql -h mysql-server.ucl.ac.uk -u ishraga -p Enter password: *******
Help me cause I'm need to both mysql and php.
Thanks, Ishraga, Sudan.
On 01/10/2007 at 1:12:25 AM EST Ojiwa wrote:
3
Hi, I am running a script file on the commandline mysql> \. staff_usage.sql I would like the result to be stored directly into a text file staff_usage.txt. How is this possible?
On 11/28/2007 at 1:59:28 AM EST hemin wrote:
4
hi,Ojiwa,u can use 'mysqldump' command to do that.
On 03/26/2009 at 6:46:58 AM EDT Anonymous wrote:
5
\.staff_usage.sql > staff_usage.txt
On 06/09/2009 at 4:46:06 AM EDT Ojiwa wrote:
6
Thank u Anonymous
Post a Comment
Recent Entries
- Cache Template in Request Setting Explained
- What Version of Java is ColdFusion Using?
- ColdFusion 9 Performance Brief from Adobe
- Request Filtering in IIS 7 Howto
- J2EE Session Cookies on ColdFusion / JRun
- Hands on ColdFusion Security Training
- ColdFusion 9 Solr Vulnerability - Are you at Risk?
- FCKEditor Year 2010 Bug for Firefox 3.6 with ColdFusion
Help me cause I'm need to both mysql and php.
Thanks, Ishraga, Sudan.







