|
|
|
|
| |
Does creating the database select it as the default (or current) database? No, it doesn't, as you can see by executing the following query:
mysql> SELECT DATABASE();
To make sampdb the default database, issue a USE statement:
mysql> USE sampdb;
mysql> SELECT DATABASE();
The other way to select a database is to name it on the command line when you invoke mysql:
% mysql sampdb
That is, in fact, the usual way to name the database you want to use. If you need any connection parameters, specify them before the database name. For example, the following two commands allow the sampadm user to connect to the sampdb database on the local host and on cobra.snake.net:
% mysql -p -u sampadm sampdb
% mysql -h cobra.snake.net -p -u sampadm sampdb
Unless specified otherwise, all the examples that follow assume that when you invoke mysql, you name the sampdb database on the command line to make it the current database. If you invoke mysql but forget to name the database on the command line, just issue a USE sampdb statement at the mysql> prompt.
|
|
|
|
|
|
| Link Partners: Asia florist, Flowers to India, Hong kong flowers, Site submit, Cheap web hosting, China florist, Japan florist |
|