《Mysql入門MySQL WorkBench管理操作MySQL教程》要點(diǎn):
本文介紹了Mysql入門MySQL WorkBench管理操作MySQL教程,希望對(duì)您有用。如果有疑問,可以聯(lián)系我們。
一 MySQL Workbench
MySQL Workbench提供DBAs和developers一個(gè)集成工具環(huán)境:
1)數(shù)據(jù)庫設(shè)計(jì)和建模
2)SQL開發(fā)(取代原來的MySQL Query Browser)
3)數(shù)據(jù)庫管理(取代原來的MySQL Administrator)
MYSQL數(shù)據(jù)庫
二 MySQL Workbench 下載和安裝
1)下載
下載: MySQL Workbench?6.09
地址:/database/29494.html
MYSQL數(shù)據(jù)庫2)安裝
MYSQL數(shù)據(jù)庫
MYSQL數(shù)據(jù)庫3)?入門數(shù)據(jù)庫實(shí)例 (sakila-db)
MYSQL數(shù)據(jù)庫下載:http://mysql-tools.com/en/downloads/mysql-databases/4-sakila-db.html
三 MySQL Workbench 使用
1)Server Administration
* 使用MySQLInstanceConfig配置MySQL以Service運(yùn)行;
* 然后使用MySQL Workbench的Server Administration的New Server Instance創(chuàng)建新的server實(shí)例@localhost;
* 使用MySQL Workbench的Server Administration的Data Dump來導(dǎo)入我們的數(shù)據(jù)庫實(shí)例sakila-db,首先導(dǎo)入sakila schema,然后導(dǎo)入sakila data,導(dǎo)入schema如下圖:
MYSQL數(shù)據(jù)庫
* 導(dǎo)入的命令行可以在workbench的log中看到,schema的導(dǎo)入如下:
代碼如下:
mysql.exe --defaults-extra-file="c:\users\AAA\appdata\local\temp\tmphjwdop" --host=localhost --user=root --port=3306 --default-character-set=utf8 --comments < "E:\\mysql\\sakila-db\\sakila-db\\sakila-schema.sql"
data的導(dǎo)入如下:
代碼如下:
mysql.exe --defaults-extra-file="c:\users\AAA\appdata\local\temp\tmpbsop_e" --host=localhost --user=root --port=3306 --default-character-set=utf8 --comments < "E:\\mysql\\sakila-db\\sakila-db\\sakila-data.sql"
* 同時(shí)也可以使用MySQL Workbench的Server Administration的Data Dump來導(dǎo)出數(shù)據(jù)庫,導(dǎo)出有兩種格式,第一為導(dǎo)出到dump project folder,每個(gè)表為一個(gè)sql文件,第二種為導(dǎo)出為self contained file,所有的表導(dǎo)出為一個(gè)sql文件;
2)SQL Development
* 使用MySQL Workbench的SQL Development的 new connection來創(chuàng)建鏈接localhost,鏈接到先前導(dǎo)入的數(shù)據(jù)庫實(shí)例sakila,如下:
MYSQL數(shù)據(jù)庫
MYSQL數(shù)據(jù)庫* 在MySQL Workbench的SQL Development的環(huán)境中查詢數(shù)據(jù)庫實(shí)例sakila的actor表內(nèi)容,如下:
MYSQL數(shù)據(jù)庫
MYSQL數(shù)據(jù)庫3)Data Modeling
MYSQL數(shù)據(jù)庫* 使用MySQL Workbench的Data Modeling的open existing EER model來打開數(shù)據(jù)庫實(shí)例sakila中的sakila.mwb文件,如下圖:
MYSQL數(shù)據(jù)庫
MYSQL數(shù)據(jù)庫* 通常地,我們使用MySQL Workbench的Data Modeling從建模開始來設(shè)計(jì)數(shù)據(jù)庫,在建模完成后導(dǎo)出為sql語句,然后再將sql導(dǎo)入到數(shù)據(jù)庫,來完成數(shù)據(jù)庫的創(chuàng)建;
完
轉(zhuǎn)載請(qǐng)注明本頁網(wǎng)址:
http://www.snjht.com/jiaocheng/2650.html