天天看點

PowerDesigner16.5操作,從mysql反向生成ER圖

(1)PowerDesigner16.5官方下載下傳

【侵删】

https://www.onlinedown.net/soft/577763.htm

(2)PowerDesigner連接配接MySQL資料庫

【PowerDesigner本身是32位的程式(此處标記,特别重要),故不管在32位或者64位作業系統中,都需要安裝32位的MySQLConnector /ODBC】

下載下傳位址:http://dev.mysql.com/downloads/connector/odbc/

https://www.jianshu.com/p/015b0eddd6ed?from=timeline

(3)用PowerDesigner導出MySql資料庫的表結構生成ER圖

https://blog.csdn.net/qq_33394878/article/details/89918966

(111)選擇odbc的資料庫:

PowerDesigner16.5操作,從mysql反向生成ER圖

(222)選擇表

PowerDesigner16.5操作,從mysql反向生成ER圖

(4444)導入sql檔案,生成模型比較快速,參考下文:

https://blog.csdn.net/csdn565973850/article/details/80812738

(5)PowerDesigner顯示Comment注釋

https://blog.csdn.net/zhc794429974/article/details/105290861

腳本方式,但我後來找了軟體自己的界面設定:

PowerDesigner16.5操作,從mysql反向生成ER圖

(6)顯示字段的comment。

https://www.cnblogs.com/fzygun/p/8705624.html

預設沒有comment:

PowerDesigner16.5操作,從mysql反向生成ER圖

修改後:

PowerDesigner16.5操作,從mysql反向生成ER圖

===================================================================================

第一步先,先多選出一列,上面的code這一列。

【tools】--【display preferences】-【table】--後面參考下圖箭頭。

PowerDesigner16.5操作,從mysql反向生成ER圖

選擇【code】這個屬性。

PowerDesigner16.5操作,從mysql反向生成ER圖

第二部再執行腳本:【tools】--【Execute Commands】--【Edit/Run script】--選擇對應腳本執行。

PowerDesigner16.5操作,從mysql反向生成ER圖

1.粘貼腳本,儲存成vbs。

Option Explicit
ValidationMode = True
InteractiveMode = im_Batch
 
Dim mdl 'the current model
 
'get the current active model
Set mdl = ActiveModel
If (mdl Is Nothing) Then
MsgBox "There is no current Model"
ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
MsgBox "The current model is not an Physical Data model."
Else
ProcessFolder mdl
End If
 
'This routine copy name into code for each table, each column and each view
'of the current folder
Private sub ProcessFolder(folder)
 
Dim Tab 'running table
for each Tab in folder.tables
if not tab.isShortcut then
if len(tab.comment) <> 0 then
tab.name = tab.name
'tab.name = tab.comment&"["&tab.name&"]"
end if
On Error Resume Next
Dim col 'running column
for each col in tab.columns
if len(col.comment) <>0 then
col.name =col.comment
end if
On Error Resume Next
next
end if
next
end sub
           

2,後續可以繼續利用這個腳本。

PowerDesigner16.5操作,從mysql反向生成ER圖

然後在【run】,就有中文了。

PowerDesigner16.5操作,從mysql反向生成ER圖

===================================================================================

(7)對Powerdesigner中的Cardinality基數了解

https://blog.csdn.net/u013474104/article/details/47420807?utm_source=blogxgwz0