Hi Mark.

On Fri, 7 Apr 2006, Mark Sargent wrote:

> To: mysql@lists.mysql.com
> From: Mark Sargent <[EMAIL PROTECTED]>
> Subject: Syntax Error
> 
> Hi All,
> 
> am trying to get up to speed on cli syntax again,
> 
> mysql> show open tables from osc
> -> 
> 
> what is wrong with the command above and the one below,
> 
> mysql> show tables from osc
> -> 

Although it is not mentioned in the syntax diagram in the 
manual, you need to terminate a mysql command with ';', like 
this:

mysql> show tables from osc;

The reason for this is that mysql allows you to spread a 
command over many lines, which can be helpfull, eg:


mysql> show create table bible_quiz_question \G
*************************** 1. row ***************************
       Table: bible_quiz_question
Create Table: CREATE TABLE `bible_quiz_question` (
  `ID` mediumint(8) unsigned NOT NULL auto_increment,
  `question_text` text NOT NULL,
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

mysql> select ID, question_text
    -> from bible_quiz_question
    -> where ID = 1
    -> ;
+----+-----------------------------------------------+
| ID | question_text                                 |
+----+-----------------------------------------------+
|  1 | How old was the first man Adam, when he died? |
+----+-----------------------------------------------+
1 row in set (0.00 sec)

So mysql will not execute the select query above, untill it 
sees the ';' that terminates the command.

This is why you were getting:

> mysql> show tables from osc
> ->

because mysql was waiting for you to type something else in, 
or terminate the command with ';'.

If you have problems displaying output because it is to 
large to fit into the table output format, you can 
terminate the mysql command with:

mysql> show tables from osc \G

instead of:

mysql> show tables from osc;

HTH

Regards

Keith

> Why do I not get any output? I was following here,
> 
> http://dev.mysql.com/doc/refman/5.1/en/show-open-tables.html
> 
> I'm a Linux user, and wish to do everything via cli as opposed to
> phpmyadmin.

That's a good way to learn how to use mysql properly. 
phpmyadmin is a usefull tool for people that allready know 
how to use mysql via the mysql monitor program (CLI 
program).

> Cheers.
> 
> Mark Sargent.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to