powerdesigner connect mysql data base , And reverse database generation E-R chart
There are many examples and tutorials like this on the Internet , Well , Anyway, the main purpose of my writing is to record and grow myself , It would be a good thing if I could help others by the way . And give it to me. Don't think I wrote too much , It's just a little bit , It's mainly about the number of cut pictures , awkward , Want to be as detailed as possible , It turns out to be a fool .
first , There are two ways to connect ,ODBC and JDBC, Most of the information I find is of these two kinds , If there's anything else I would like to know .ODBC Download required mysql drive ,JDBC need 32 Bitwise JDK, The reason is powerdesigner In itself 32 Bit program . With all due respect , Now it is used in development 32 position JDK Less , Build two JDK Switch back and forth , Too unfriendly for developers .
The first ,ODBC Of , Download two drivers first mysql-connector-odbc-5.2.7-winx64.msi and mysql-connector-odbc-5.2.7-win32.msi, Paste these two names into Baidu , Then you can go directly to the official website , Double click Install after downloading , Install first 64 Bitwise , Reinstallation 32 Bitwise . Here's an explanation , In fact, it uses 32 Bitwise , But look at other tutorials , No 64 No way , So let's pretend .
open powerdesigner, Create a new model ,New Model——Model types——Physical Data Model——Physical
DBMS choice mysql5.0,Model name Name it , It doesn't matter . Then click OK So we built a model .
After that, we need to connect this model to the database , Top menu bar Database——Update Model from Database
A box will pop up later , As shown below , among 1 It shows the selected database connection , choice 2 The interface for selecting database connection will pop up
choice 2 in the future , The following right interface will pop up ,1 Here is a drop-down box to select the connection ,2 place Modify You can open an interface to edit the selected connection ,3 place Configure Pop up interface , All connections can be displayed and new connections can be edited and added .
Take adding as an example , Anyway, the editing and adding interface are the same , Click on the Configure, The following interface will pop up , click 1 place
The following interface will pop up , choice “ System data source ”
choice Mysql ODBC 5.2 Unicode Driver
（ If there is no driver installed before, there is no driver here ）, By the way , here you are ANSI and Unicode Two character set versions of Driver, use Unicode, Because it provides a richer character set . And then the next step , complete
When finished, it will be displayed as follows , The first is a name of its own , at will ; The second is the description , More casual ,TCP/IP Is the point , Local filling localhost perhaps 127.0.0.1, Remote filling IP, Interfaces are generally default 3306;lNamed
Pipe It's another way to connect , Here I Baidu to paste it , I don't really understand ： Named pipe connection , Only for widows Local connection under . Connection performance ratio TCP/IP Higher way , More secure . Please follow MySQL Profile for my.ini In socket Fill in the value specified by the parameter , Default if not set MySQL; Here is the user password library name and so on , No need to say more , Click after input test, It usually shows success .（ Because I haven't had an unsuccessful situation , If you meet , Check the network ,IP, user , Password or something
complete , You'll find an extra connection , determine ; In the pop-up box below , Check this connection in the drop-down box ,Connect;
This page , Click OK
Here comes the point !!! I've been trapped for countless times !!
By default, all tables under all users are selected , This and oracle Different databases .1 All of them ,2 No choice , spot 2!!! Then switch to the user you want to create , Just in case , Manually check the table to display . Then click OK, Default after that , confirm , This will show E-R The picture .
The display effect is as follows , Are you disappointed? No notes , Clam clam , Next time I'll talk about the problem of displaying notes , La La La ~
Fuck , The first method has been written for so long , The second one doesn't want to write , Ah , Make a fool of it ~~~
The second ,JDBC. Install first 32 Bitwise JDK, I don't need to tell you where to download it ? I usually go to the official website , Attached with a wave of address http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html, Then there is the configuration of environment variables , Not to mention that .
open powerdesigner,Database——connect, Select in the pop-up box Connection
profile, choice Configure, Create a new connection , Here's a crazy screenshot
After completion, see the following figure
The following passage is copied from the online tutorial
lConnection profile name:JDBC Profile name , Can be filled in at will
lDirectory: Profile save path
lDescription: Profile description , It can be filled in according to the actual use
lConnection type： Connection mode , Here we choose JDBC
lDBMS type： Database type , Most mainstream database options available , We choose MySQL
lUser name： User name to log in to the database
lJDBC driver class： Specify driver class , Use default com.mysql.jdbc.Driver
lJDBC connection URL： connect URL, format jdbc:mysql://ServerIP/Hostname:port/database
lJDBC driver jar files： Specify connected jar Package path
It's a demonstration of mistakes ~~~ If you do not configure jdk32 A few words , The above error will be displayed ; If it is configured, it will pop up Connection test Successful,OK!!!