1

I have an .sql script that contains inserts and creates tables. I used the "Create EER Model From Script"

It created the tables but I can't see the data inside these tables.

I went to the query menu and tried to make a query but it gives me an error about not being able to connect to localhost.

Am I doing it right?

dgilperez
  • 10,716
  • 8
  • 68
  • 96
chobo2
  • 83,322
  • 195
  • 530
  • 832

2 Answers2

1

As documented under Create EER Model from SQL Script:

Clicking this action item launches the Reverse Engineer SQL Script wizard. This is a multi-stage wizard that enables you to select the script you want to create your model from.

For further information, see Section 7.7.9.1, “Reverse Engineering Using a Create Script”.

Following that link:

However, if you are working with a script that also contains DML statements you need not remove them; they will be ignored.

Instead, you want the Manage Data Import/Export option under Server Administration (within the Workspace section of the Home window).

eggyal
  • 122,705
  • 18
  • 212
  • 237
  • hmm still not getting this. I tried just opening their demo one("sakila_full") but don't get how to see if the data(if there is even any). Maybe I am not using the right thing. I have a db script that creates tables and inserts data. HOw can I create the db and look at the data locally? – chobo2 Jun 12 '13 at 20:21
  • Hmm does the workbench come with the actual mysql server or is that a separate download as that maybe my problem. – chobo2 Jun 12 '13 at 20:51
  • @chobo2: Workbench is merely a client program; the server is entirely separate. – eggyal Jun 12 '13 at 20:52
  • hmm what is the quickest way to get the data to mssql? That is really the end old I wanted to see if the data is useful and then import it into mssql. Was hoping that I could quickly look at it through workbench but don't really want to setup the server. The script seems to be just create tables and insert. Nothing too fancy. – chobo2 Jun 12 '13 at 20:57
  • @chobo2: There are third party tools out there that can perform the migration for you; or, if the MySQL dumpfile was created with the [`--compatible=mssql`](http://dev.mysql.com/doc/en/mysqldump.html#option_mysqldump_compatible) option, it should work fine. – eggyal Jun 12 '13 at 21:00
  • Do you have any recommendations. I have this huge file and want it in mssql server. Everything on the site I am getting it from is setup for php and mysql. http://www.product-open-data.com/docs/pod_web_2013.06.04_01.sql.gz – chobo2 Jun 13 '13 at 17:22
0

You are confusing things here. Creating a model from a script is a process where meta data is examined and a model is created that you can then use to modify your schema structure, further design your db objects and all that. Modeling is a design process for the structure of your schema/db so it only deals with meta data. It's also used for documentation (e.g. in teams).

On the other hand there's normal sql work with existing db objects and/or actually creating/deleting/modifying db objects. In order to do the latter you must have an understanding of the design of the schema (which you could get by using the modeling part of MySQL Workbench, but not only by that). This is also the place to load a script, run it to insert data and such.

The error you mentioned regarding the connection is yet another problem and you need to solve this first to be able to even access your server. And yes, you have to install a server first somewhere. MySQL Workbench is a tool to visually work with your server(s) in opposition to the MySQL command line client which is a pure text interface (but still also a client application for your MySQL servers).

If you are on Windows and want a MySQL server installed locally (e.g. for testing) your best option is to download the MySQL Installer which greatly simplifies installing any of the tools from the MySQL family (server, client tools, connectors, documentation and more).

Mike Lischke
  • 48,925
  • 16
  • 119
  • 181