您好,登錄后才能下訂單哦!
下面講講關(guān)于MySQL5.6連接與斷開mysql的詳細(xì)方法,文字的奧妙在于貼近主題相關(guān)。所以,閑話就不談了,我們直接看下文吧,相信看完MySQL5.6連接與斷開mysql的詳細(xì)方法這篇文章你一定會有所受益。
3.1連接和斷開與云服務(wù)器的連接
To connect to the server, you will usually need to provide a MySQL user name when you invoke mysql and, most likely, a password. If the server runs on a machine other than the one where you log in, you will also need to specify a host name. Contact your administrator to find out what connection parameters you should use to connect (that is, what host, user name, and password to use). Once you know the proper parameters, you should be able to connect like this:
為了連接服務(wù),你通常需要提供一個MySQL用戶名,可能還需要密碼。如果服務(wù)不在你所登陸的fu wu qish云服務(wù)器上運行,你還需要指定云服務(wù)器的主機(jī)名(或IP地址)。請與您的管理員聯(lián)系,找出您應(yīng)該使用哪些連接參數(shù)進(jìn)行連接(即要使用的主機(jī)名,用戶名和密碼)。一旦你知道正確的參數(shù),你應(yīng)該可以這樣連接:
shell> mysql -h host -u user -pEnter password: ********
host and user represent the host name where your MySQL server is running and the user name of your MySQL account. Substitute appropriate values for your setup. The ******** represents your password; enter it when mysql displays the Enter password: prompt.
If that works, you should see some introductory information followed by a mysql> prompt:
host和user 象征著MySQL云服務(wù)器的主機(jī)名和MySQL賬戶的用戶名。為您的設(shè)置替換成適當(dāng)?shù)闹怠?*******代表你的密碼; 當(dāng)mysql顯示Enter password:提示時輸入。
如果配置正確,你應(yīng)該看到一些介紹性信息,然后是一個mysql>提示:
shell> mysql -h host -u user -pEnter password: ******** Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 25338 to server version: 5.6.38-standard Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql>
The mysql> prompt tells you that mysql is ready for you to enter SQL statements.
If you are logging in on the same machine that MySQL is running on, you can omit the host, and simply use the following:
mysql>提示 告訴你MySQL已經(jīng)準(zhǔn)備好讓您輸入SQL語句了。
假如MySQL運行的云服務(wù)器與你登陸的設(shè)備是同一臺,你可以省略主機(jī)名設(shè)置,只需使用以下命令:
shell> mysql -u user -p
If, when you attempt to log in, you get an error message such as ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2), it means that the MySQL server daemon (Unix) or service (Windows) is not running. Consult the administrator or see the section of Chapter 2, Installing and Upgrading MySQL that is appropriate to your operating system.
For help with other problems often encountered when trying to log in, see Section B.5.2, “Common Errors When Using MySQL Programs”.
Some MySQL installations permit users to connect as the anonymous (unnamed) user to the server running on the local host. If this is the case on your machine, you should be able to connect to that server by invoking mysqlwithout any options:
如果您嘗試登錄時會收到錯誤消息(如 ERROR 2002(HY000)):無法通過套接字'/tmp/mysql.sock'(2)連接到本地MySQL云服務(wù)器,這意味著MySQL云服務(wù)器守護(hù)進(jìn)程(Unix)或服務(wù)(Windows)未運行。請咨詢管理員或參閱 第2章適用于您的操作系統(tǒng)的安裝和升級MySQL部分。
有關(guān)嘗試登錄時經(jīng)常遇到的其他問題的幫助,請參見第B.5.2節(jié)“使用MySQL程序時的常見錯誤”。
一些MySQL安裝允許用戶作為匿名(未命名)用戶連接到在本地主機(jī)上運行的云服務(wù)器。如果您的機(jī)器是這種情況,您應(yīng)該能夠通過調(diào)用mysql連接到該云服務(wù)器,而不需要任何選項:
shell> mysql
After you have connected successfully, you can disconnect any time by typing QUIT (or \q) at the mysql> prompt:
連接成功后,您可以通過在提示符下鍵入QUIT(或\q)斷開連接mysql>:
mysql> QUIT Bye
On Unix, you can also disconnect by pressing Control+D.
Most examples in the following sections assume that you are connected to the server. They indicate this by themysql> prompt.
在Unix上,也可以通過按Control + D斷開連接。
以下部分中的大多數(shù)示例假定您已連接到云服務(wù)器。他們通過mysql>提示來表示這一點 。
對于以上MySQL5.6連接與斷開mysql的詳細(xì)方法相關(guān)內(nèi)容,大家還有什么不明白的地方嗎?或者想要了解更多相關(guān),可以繼續(xù)關(guān)注我們的行業(yè)資訊板塊。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。