Search This Blog

Creating and Selecting a Database

If the administrator creates your database for you when setting up your permissions, you can begin using it. Otherwise, you need to create it yourself:
mysql> CREATE DATABASE menagerie;
Under Unix, database names are case sensitive (unlike SQL keywords), so you must always refer to your database as menagerie, not as Menagerie, MENAGERIE, or some other variant. This is also true for table names. (Under Windows, this restriction does not apply, although you must refer to databases and tables using the same lettercase throughout a given query. However, for a variety of reasons, our recommended best practice is always to use the same lettercase that was used when the database was created.)

Creating a database does not select it for use; you must do that explicitly. To make menagerie the current database, use this command:
mysql> USE menagerie
Database changed
Your database needs to be created only once, but you must select it for use each time you begin a mysql session. You can do this by issuing a USE statement as shown in the example. Alternatively, you can select the database on the command line when you invoke mysql. Just specify its name after any connection parameters that you might need to provide. For example:
shell> mysql -h host -u user -p menagerie
Enter password: ********
Note that menagerie in the command just shown is not your password. If you want to supply your password on the command line after the -p option, you must do so with no intervening space (for example, as -pmypassword, not as -p mypassword). However, putting your password on the command line is not recommended, because doing so exposes it to snooping by other users logged in on your machine.

other:


A database is a system intended to organize, store, and retrieve large amounts of data easily. It consists of an organized collection of data for one or ...
en.wikipedia.org
EBSCOhost (ebscohost.com) serves thousands of libraries and other institutions with premium content in every subject area. Free LISTA: LibraryResearch.com.
search.ebscohost.com
This page describes the term database and lists other pages on the Web where you can find additional information.
www.webopedia.com
The software's official homepage with news, downloads and documentation.
www.mysql.com

0 comments:

Post a Comment

Followers