|
Home > Archive > MySQL ODBC Connector > April 2006 > Syntax Error
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Mark Sargent 2006-04-07, 3:35 am |
| -------------- 01010802060100000601
0704
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
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
->
Why do I not get any output? I was following here,
http://dev.mysql.com/doc/refman/5.1...pen-tables.html
I'm a Linux user, and wish to do everything via cli as opposed to
phpmyadmin.
Cheers.
Mark Sargent.
-------------- 01010802060100000601
0704
Content-Type: text/plain; charset=us-ascii
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql? unsub...sie.nctu.edu.tw
-------------- 01010802060100000601
0704--
| |
| Mark Sargent 2006-04-07, 3:35 am |
| -------------- 04090909060802090509
0509
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hi All,
Ah, sorry, a semicolon makes it a whole new world, eh.
Cheers.
Mark Sargent.
-------------- 04090909060802090509
0509
Content-Type: text/plain; charset=us-ascii
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql? unsub...sie.nctu.edu.tw
-------------- 04090909060802090509
0509--
| |
| mysql@karsites.net 2006-04-07, 7:32 am |
| Hi Mark.
On Fri, 7 Apr 2006, Mark Sargent wrote:
> To: mysql@lists.mysql.com
> From: Mark Sargent <mark@diabro.jp>
> 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...pen-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/mysql? unsub...sie.nctu.edu.tw
|
|
|
|
|