3.1數(shù)據(jù)庫(kù)連接管理
登錄數(shù)據(jù)庫(kù)系統(tǒng)
在命令行中登錄mysql數(shù)據(jù)庫(kù)管理系統(tǒng),其中“-h”參數(shù)指連接的主機(jī)名,因?yàn)榇颂幨沁B接本機(jī),所以后面的內(nèi)容為localhost;“-u”參數(shù)表示用戶名,此處的用戶名為root:“-p”參數(shù)指用戶密碼。按下回車鍵顯示輸入密碼提示mysql -h localhost -u root -p
3.2數(shù)據(jù)庫(kù)的啟動(dòng)流程圖介紹
3.3 mysql命令,接口自帶功能(常用舉例)
\h或help或?
**mysql> \h #?號(hào)的效果相同的
For information about MySQL products and services, visit:
http://www.mysql.com/
For developer information, including the MySQL Reference Manual, visit:
http://dev.mysql.com/
To buy MySQL Enterprise support, training, or other products, visit:
https://shop.mysql.com/
List of all MySQL commands:
Note that all text commands must be first on line and end with ';'
? (\?) Synonym for `help'.
clear (\c) Clear the current input statement.
connect (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
edit (\e) Edit command with $EDITOR.
ego (\G) Send command to mysql server, display result vertically.
exit (\q) Exit mysql. Same as quit.
go (\g) Send command to mysql server.
help (\h) Display this help.
nopager (\n) Disable pager, print to stdout.
notee (\t) Don't write into outfile.
pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.
print (\p) Print current command.
prompt (\R) Change your mysql prompt.
quit (\q) Quit mysql.
rehash (\#) Rebuild completion hash.
source (\.) Execute an SQL script file. Takes a file name as an argument.
status (\s) Get status information from the server.
system (\!) Execute a system shell command.
tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
use (\u) Use another database. Takes database name as argument.
charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
warnings (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.
For server side help, type 'help contents'**
3.4\Gmysql中在sql語(yǔ)句后面加\G表示將查詢結(jié)果按列打印,默認(rèn)情況下,mysql的查詢結(jié)果是橫向輸出的,第一行是列頭,后面是記錄集,
3.5\c或者CTRL+c 這里表示的是取消的意思mysql> asdfasdlkjlds \c
3.6mysql命令,source命令使用
在mysql中處理文件
如果這些文件包含sql語(yǔ)句,則稱為“腳本文件”,“批處理文件”
使用SOURCE命令mysql> source /root/world.sql
3.7 mysql數(shù)據(jù)庫(kù)的關(guān)閉
方法一:mysqladmin -uroot -p123456 shutdown
方法二:service mysqld stop
方法三:/etc/init.d/mysqld stop
第四種方法是利用系統(tǒng)進(jìn)程管理命令關(guān)閉mysql
kill pid #這里的pid為數(shù)據(jù)庫(kù)服務(wù)對(duì)應(yīng)的進(jìn)程號(hào)
killall mysqld #這里的mysqld是數(shù)據(jù)庫(kù)對(duì)應(yīng)的進(jìn)程名字
pkill mysqld #這里的mysqld是數(shù)據(jù)庫(kù)服務(wù)對(duì)應(yīng)的進(jìn)程名字
3.8my.cnf配置文件說(shuō)明
影響到服務(wù)器進(jìn)程的啟動(dòng)
影響到客戶端程序
mysql程序主配置文件
3.9配置文件讀取過(guò)程/etc/my.cnf --> /etc/mysql/my.cnf --> $MYSQL_HOME/my.cnf --> defaults-extra-file=/tmp/clsn.txt --> ~/.my.cnf
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
分享文章:MYSQL企業(yè)級(jí)應(yīng)用(三)基本管理-創(chuàng)新互聯(lián)
網(wǎng)站網(wǎng)址:http://www.yijiale78.com/article6/hhcog.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)公司、品牌網(wǎng)站設(shè)計(jì)、關(guān)鍵詞優(yōu)化、App設(shè)計(jì)、Google
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容