《Mysql入門MySQL WorkBench管理操作MySQL教程》要點:
本文介紹了Mysql入門MySQL WorkBench管理操作MySQL教程,希望對您有用。如果有疑問,可以聯(lián)系我們。
一 MySQL Workbench
MySQL Workbench提供DBAs和developers一個集成工具環(huán)境:
1)數(shù)據(jù)庫設(shè)計和建模
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ù)庫實例 (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運行;
* 然后使用MySQL Workbench的Server Administration的New Server Instance創(chuàng)建新的server實例@localhost;
* 使用MySQL Workbench的Server Administration的Data Dump來導入我們的數(shù)據(jù)庫實例sakila-db,首先導入sakila schema,然后導入sakila data,導入schema如下圖:
MYSQL數(shù)據(jù)庫
* 導入的命令行可以在workbench的log中看到,schema的導入如下:
代碼如下:
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的導入如下:
代碼如下:
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"
* 同時也可以使用MySQL Workbench的Server Administration的Data Dump來導出數(shù)據(jù)庫,導出有兩種格式,第一為導出到dump project folder,每個表為一個sql文件,第二種為導出為self contained file,所有的表導出為一個sql文件;
2)SQL Development
* 使用MySQL Workbench的SQL Development的 new connection來創(chuàng)建鏈接localhost,鏈接到先前導入的數(shù)據(jù)庫實例sakila,如下:
MYSQL數(shù)據(jù)庫
MYSQL數(shù)據(jù)庫* 在MySQL Workbench的SQL Development的環(huán)境中查詢數(shù)據(jù)庫實例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ù)庫實例sakila中的sakila.mwb文件,如下圖:
MYSQL數(shù)據(jù)庫
MYSQL數(shù)據(jù)庫* 通常地,我們使用MySQL Workbench的Data Modeling從建模開始來設(shè)計數(shù)據(jù)庫,在建模完成后導出為sql語句,然后再將sql導入到數(shù)據(jù)庫,來完成數(shù)據(jù)庫的創(chuàng)建;
完
轉(zhuǎn)載請注明本頁網(wǎng)址:
http://www.fzlkiss.com/jiaocheng/2650.html