Cov txheej txheem:

Kuv yuav tsim cov ntaub ntawv SQL hauv MySQL workbench li cas?
Kuv yuav tsim cov ntaub ntawv SQL hauv MySQL workbench li cas?

Video: Kuv yuav tsim cov ntaub ntawv SQL hauv MySQL workbench li cas?

Video: Kuv yuav tsim cov ntaub ntawv SQL hauv MySQL workbench li cas?
Video: Python! Writing a Dictionary to CSV 2024, Kaum ib hlis
Anonim

Rau tsim a tsab ntawv los ntawm ib daim duab hauv MySQL Workbench : Xaiv Cov ntaub ntawv > Export > Forward Engineer SQL CREATE Script Nkag mus rau qhov chaw khaws cia ntaub ntawv (optional) thiab teeb tsa cov kev xaiv kom suav nrog rau ntawm tsab ntawv (xws li DROP nqe lus thiab lwm yam), ces nyem Txuas ntxiv.

Tsis tas li ntawd, kuv yuav qhib cov ntaub ntawv SQL hauv MySQL workbench li cas?

Qhib MySQL Workbench , xaiv tus qauv saib los ntawm sidebar nyob rau hauv lub tsev tshuaj ntsuam, nyem (>) ib sab ntawm Cov Qauv, thiab ces nias Rov qab Engineer MySQL Tsim Tsab ntawv . Nrhiav thiab import cov sakila-schema. sql ua . Qhov no yog qhov tsab ntawv uas muaj cov ntaub ntawv txhais cov nqe lus rau sakila database.

Tom qab ntawd, lo lus nug yog, Kuv yuav ua li cas khiav ib tsab ntawv hauv MySQL?

  1. Tam sim no, Cov Ntaub Ntawv -> Qhib SQL Script los qhib SQL tsab ntawv.
  2. Tom qab tshawb xyuas.sql cov ntaub ntawv, koj yuav tsum xaiv qhov kev xaiv "Reconnect rau database" raws li qhia hauv qab no screenshot -
  3. Tam sim no, nws yuav nug tus password los txuas nrog MySQL.
  4. Nco tseg - Nias OK khawm ob zaug txuas nrog MySQL.
  5. Tom qab ntawd koj yuav tsum tau ua cov ntawv sau.

Ntawm no, kuv yuav ua li cas thiaj tsim tau. SQL cov ntaub ntawv hauv MySQL?

Yog koj xav tau tsim ib tug tshiab database rau lub SQL file , koj tuaj yeem ua nws nrog cov lus txib hauv qab no: mysql > Tsim DATABASE DatabaseName; Rau tsim a MySQL tus neeg siv thiab muab tus password tshiab rau nws, khiav cov lus txib hauv qab no: mysql > Tsim USER 'DatabaseUser' @ 'localhost' IDENTIFIED BY 'password';

Kuv yuav khiav SQL li cas?

Txhawm rau ua cov ntawv sau los ntawm nplooj ntawv SQL Scripts:

  1. Ntawm nplooj ntawv chaw ua haujlwm, nyem SQL Rhiav thiab tom qab ntawd SQL Scripts.
  2. Los ntawm Saib daim ntawv teev npe, xaiv Cov Lus Qhia thiab nyem Mus.
  3. Nyem rau Khiav icon rau tsab ntawv koj xav ua.
  4. Nplooj ntawv Run Script tshwm.
  5. Nyem Khiav kom xa tsab ntawv rau kev ua tiav.

Pom zoo: