MySQL通常用Telnet進行登錄(一個非常好的Telnet軟件名為Easyterm,可以從 http://www.arachnoid.com/下載)。我們向用戶推薦使用WinMysql 管理工具,下載網(wǎng)址是http://www.tcx.se/Downloads/Win32/myAdmin1.0.1.0.zip 通過Telnet與web服務器連接后,第二個命令提供MySQL服務器的登錄。登錄的步驟如下:
1. 連接到服務器。
--------------------------------------------------------------------------------
login: devshed
Password: ********
Last login: Wed Aug 12 09:49:14 from 195.103.124.222
Copyright 1992, 1993, 1994, 1995, 1996 Berkeley Software Design, Inc.
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.
BSDI BSD/OS 2.1 Kernel #12: Mon Feb 23 13:46:27 EST 1998
You have new mail.
www24:mywww/devshed#
--------------------------------------------------------------------------------
2. 登錄到MySQL帳戶。
--------------------------------------------------------------------------------
www24:mywww/devshed# mysql -u devshed -p
--------------------------------------------------------------------------------
Syntax: mysql -h hostname -u username -p[password]
Or
mysql -h hostname -u username --password=password
用戶會被提示輸入密碼。-p表示輸入密碼。
--------------------------------------------------------------------------------
Enter password: *******
--------------------------------------------------------------------------------
用戶會看見如下結(jié)果:
--------------------------------------------------------------------------------
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 49 to server version: 3.21.23-beta-log
Type help for help.
mysql>
--------------------------------------------------------------------------------
登錄到數(shù)據(jù)庫之后,我們就可以執(zhí)行各種MySQL的命令,但在對數(shù)據(jù)庫操作之前必須要先調(diào)用數(shù)據(jù)庫,也就是與數(shù)據(jù)庫建立連接:
--------------------------------------------------------------------------------
mysql> use devshed;
--------------------------------------------------------------------------------
結(jié)果:
--------------------------------------------------------------------------------
Database changed
Mysql>
--------------------------------------------------------------------------------
現(xiàn)在你已經(jīng)連接到數(shù)據(jù)庫。注意命令后面要加上分號(;),幾乎所有的MySQL命令都要加分號。有關(guān)管理數(shù)據(jù)庫的命令可以通過鍵入help, \h 或?列出來。
--------------------------------------------------------------------------------
mysql> help
help (\h) Display this
text ? (\h) Synonym for `help
clear (\c) Clear command
connect (\r) Reconnect to the server. Optional arguments are db and host
edit (\e) Edit command with $EDITOR
exit (\) Exit mysql. Same as quit
go (\g) Send command to mysql server
print (\p) print current command
quit (\q) Quit mysql
rehash (\#) Rebuild completion hash
status (\s) Get status information from the server
use (\u) Use another database. Takes database name as argument
Connection id: 49 (Can be used with mysqladmin kill)
mysql>
--------------------------------------------------------------------------------
也許這些功能不會都能用上,但應該知道每一個命令都會做什么。象命令status, use, print, connect, clear, 和quit在最開始學習使用時都會十分有用,F(xiàn)在,你應該對連接數(shù)據(jù)庫、選擇數(shù)據(jù)庫和運行基本命令都應該有一定的了解。下一步將講解有關(guān)對數(shù)據(jù)庫進行操作的基本概念和方法。
服務器租用托管聯(lián)系億恩小易:1355017510QQ
本文出自:億恩科技【www.allwellnessguide.com】
服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|