see section '4.8.2 mysql, The Command-line Tool' in the manual

if you normally see 'mysql>' as your prompt. the following command would do
it:
mysql> prompt \d>

resulting in, for example, the prompt of 'test>' where you are using the
database 'test'.

'\u' would give you the username, e.g.

mysql> prompt (d=\d, u=\u)>

it is a good idea to add a space at the end of the line when using the
prompt command.

also of interest are:
select database();
show processlist;





----- Original Message -----
From: "Michael Welsh" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 13, 2003 2:07 PM
Subject: USE database prompt


>
> MySQL v 3.23.56 for pc-linux-gnu on i686
>
> How do I know what database I am 'using' ?
>
> I launch mysql from the command line.  Type 'show databases', then pick a
> database to use by typing 'use databasename'.  I am now using that
database
> but have no visual cue.
>
> How do I include the username, database name, etc in the 'mysql>' prompt?
>
> Note, I can customize the command prompt on linux to include
> user, host, directory, etc.. so I always know who I am and where I am.
>
> Michael
>
> end of message --------------------------------
>
> _________________________________________________________________
> The new MSN 8: advanced junk mail protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.507 / Virus Database: 304 - Release Date: 04/08/2003


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

Reply via email to