真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

MySQL是如何創(chuàng)建并選擇數(shù)據(jù)庫的

本文主要給大家介紹MySQL是如何創(chuàng)建并選擇數(shù)據(jù)庫的,文章內(nèi)容都是筆者用心摘選和編輯的,具有一定的針對性,對大家的參考意義還是比較大的,下面跟筆者一起了解下MySQL是如何創(chuàng)建并選擇數(shù)據(jù)庫的吧。

我們提供的服務有:成都網(wǎng)站設計、網(wǎng)站制作、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認證、洞頭ssl等。為近千家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務,是有科學管理、有技術的洞頭網(wǎng)站制作公司

3.3.1 Creating and Selecting a Database

3.3.1 創(chuàng)建 選擇數(shù)據(jù)庫

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:

如果管理員為你創(chuàng)建數(shù)據(jù)庫并 為你設置了權限,你可以使用它。否則,您需要自己創(chuàng)建數(shù)據(jù)庫:

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, the recommended best practice is always to use the same lettercase that was used when the database was created.)

在Unix下,數(shù)據(jù)庫名稱是區(qū)分大小寫的(不像SQL關鍵字),所以你必須總是指到你的數(shù)據(jù)庫 menagerie,而不是 Menagerie,MENAGERIE或一些其他變種。表名也是如此。(windows 下,大小寫不敏感,你最好使用與建表或者建庫時相同的拼寫。)

Note

If you get an error such as ERROR 1044 (42000): Access denied for user 'micah'@'localhost' to database 'menagerie' when attempting to create a database, this means that your user account does not have the necessary privileges to do so. Discuss this with the administrator or see Section 6.2, “The MySQL Access Privilege System”.

注意

如果您收到 ERROR 1044 (42000): Access denied for user 'micah'@'localhost' to database 'menagerie',這意味著您的用戶帳戶沒有鎖必須的權限。請與管理員討論,或參見第6.2節(jié)“MySQL訪問特權系統(tǒng)”。

Creating a database does not select it for use; you must do that explicitly. To make menagerie the current database, use this statement:

創(chuàng)建數(shù)據(jù)庫并沒有選擇使用它,你必須特別的指定,讓menagerie成為現(xiàn)在使用的數(shù)據(jù)庫,使用以下語句:

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:

您的數(shù)據(jù)庫只需要創(chuàng)建一次,但是每次開始mysql 會話時都必須選擇它。您可以通過發(fā)出USE如示例中所示的語句來執(zhí)行此操作 ?;蛘?,您可以在調(diào)用mysql時在命令行中選擇數(shù)據(jù)庫。只需在您可能需要提供的任何連接參數(shù)之后指定其名稱。例如:

shell> mysql -h host -u user -p menagerie
Enter password: ********

Important

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.

重要

在剛剛的命令中 menagerie不是你的密碼。如果要在-p選項之后的命令行中提供密碼 ,你必須在-p選項后不插入空格馬上輸入(例如, -pmypassword 不是-p mypassword)。但是,不建議將密碼放在命令行上,因為這樣做會使其被登錄到您的計算機上的其他用戶窺探。

Note

You can see at any time which database is currently selected using SELECT DATABASE().

看完以上關于MySQL是如何創(chuàng)建并選擇數(shù)據(jù)庫的,很多讀者朋友肯定多少有一定的了解,如需獲取更多的行業(yè)知識信息 ,可以持續(xù)關注我們的行業(yè)資訊欄目的。


名稱欄目:MySQL是如何創(chuàng)建并選擇數(shù)據(jù)庫的
URL網(wǎng)址:http://weahome.cn/article/piijds.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部