Generate Visio ERD from existing MySQL Database - mysql

Is there a simple way to generate an ERD in Visio from an existing MySQL Database? I'm aware that this is possible in MySQL Workbench, but I have a requirement for it to be done in Visio. Or otherwise can I convert an ERD made in MySQL Workbench to a format Visio can open?

Yes, it can be done in Visio. You need to use the reverse engineer feature.
Here is a blog post explaining the basic steps:
http://maniish.wordpress.com/2007/11/24/reverse-engineer-mysql-in-visio-2007/

The above is all correct. You also must pay special attention to your application's architecture. We fought the MySQL ODBC configured UserDSN not being visible in the Reverse Engineer dialog, including using multiple versions of ODBC. We finally figured out we had to install 32 bit ODBC drivers on a 64 bit Windows machine because the Visio 2K10 that was installed was a 32 bit app.
At first we installed 64 bit ODBC because this was a 64 bit machine (sounded logical). I finally found an article that mentioned the app architecture was the determining factor for ODBC. After installing the 32 bit MySQL ODBC drivers (right over the top of the previous ones) and delete/recreate the DSN connection, the drivers were visible in the dialog and the Reverse Engineer process worked.

Related

An error happened while reading data from the provider: A call to SSPI failed, see inner exception

Grr - I hate upgrades that break things
I have upgrade MySql Connector/Net to 8.0.31 from I think it was 8.0.28. And also the ODBC (both 32 and 64 bit) to same.
I think this has broken my Excel Power Query connectors which connect a spreadsheet to a database as I'm getting the title error message. Having similar issues with Power BI connectors as well.
I can't trace the inner exception as there is no ability with Excel / Power Query to do this unless I missing something. Other answers talk about this being security stuff but I have no way of changing/altering this.
Even more frustrating is that this message appears on some of my databases but not all.
The underlying MySql database is very old at 5.6.10 (and I have no way of upgrading this)
I'd downgrade back to 8.0.28 (at least it worked) but I'm not sure how feasible of otherwise that is. I get the impression
I can happily query via a SQL tool (e.g. dbeaver or MySQL Workbench) so this is something else.
Any ideas on what I can do to fix this?
Thanks
EDIT:
So I downgrade MySQL Connector t0 8.0.28 (by using Windows Programs and uninstall the various MySQL 'upgraded' component so that downgrade to versions I wanted)
Still had the error. It is very much a security issue and disabling encrypted connection has fixed most of it.
Like to know why this happened as not happy exposing more than I want too.
Phew.
My workaround is to use an odbc connection string.
you'll need the MySQL ODBC driver instead of the .NET that cause the issue.
Download here: https://dev.mysql.com/downloads/file/?id=513647
In powerBI go to 'Get data' and select more. On the bottom of the list of sources is the 'Other' option and about half way is the ODBC.
In case you need an example: https://www.connectionstrings.com/mysql-connector-odbc-5-2/

MySQL to Oracle DB Migration

I have a task to Migrate MySQL DB to Oracle (its my requirement) i tried to Migrate using SQL developer as defined in below link.
https://www.packtpub.com/books/content/migrating-mysql-table-using-oracle-sql-developer-15
As the DB is huge, the constraints are not copied properly from MySQL to Oracle, i need to define/alter/add constraints explicitly, which is time consuming (SQL developer migrates data 300rec/min from mysql to Oracle) & the entire procedure, views, functions is need to re write.
How can i ensure that data has migrated properly or not.?
Is this is a right approach to migrate?
Should i move to any tool which helps to Migrate? If yes please suggest the tool..!!
Or it is the right thing to Move from MySQL to Oracle.
Thanks in Advance.
No specific answer, but some genaral thoughts based on my experiences with migration.
I've found that there normally isn't one tool that does the whole migration job well, and by whole job I mean:
Fast
Handles all data types, scenarios
And that is from Oracle to Oracle!!
Last project we tried Oracle Golden Gate, and found there were issues with that.
We always end up with a hybrid approach, somethings like:
Extract all DDL manually and pre-create objects - there are weaknesses in the stagndard tools that confound them when extracting DDL, e.g. we found 10g expdp did not handle some quirky PLSQL well, so we resorted to extracting this ourselves.
Some tables work well with SQL Loader, others with GG, others (rare) with a custom extract and load process. We had over 3,500 tables and identified about 100 that worked better done as SQLLoader rather than GG. When I say better I mean with data handling and speed of migration. We created different groups of processing each group having a different method.
Once we have an overall hybrid scheme that works, we tune, mainly by splitting that task into parallel processes, both the export and import side.
All my migrations have been big projects where we have shifted from one Oracle system/server to another, always with the target being a newer version of OS and Oracle.
So, I would imagine that migration between non-Oracle and Oracle will through up even more challenges, and probably not as trivial as imply clicking a few buttons in SQL*Developer.
You may find the expected content from the SQL developer documentation at the Oracle website.
There are migration information available for all Microsoft Access users, MySQL users, Microsoft SQL Server and Sybase Adaptive Server users.
You can also download the tutorial in forms of PDF (best for offline viewing and printing), ePub (best for most mobile devices) and Mobi (best for Amazon Kindle devices).
Recently, I have successfully migrated the MySQL database to Oracle database. Below are detail steps:
Operating System: Desktop Ubuntu local and Desktop Ubuntu on amazon aws
Please Note: Here I am using aws desktop ubuntu server because my mysql
database was pretty big. In my case there were 800 tables, 200 views,
procedures, triggers, and functions. The total size of the database was almost
20GB. In case of small database I would recommend to use local ubuntu server.
Tools Used: SQL Developer, VNCServer, Remote Desktop Client, JAVA 8, Third Party MySql JDBC Driver
1. Setup ec2 ubuntu desktop server : https://www.youtube.com/watch?v=ljvgwmJCUjw
2. Install SQL Developer on #1
Download the SQL Developer package from this link :
http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html
Accept the license agreement and download "Other Platforms" for ubuntu.
Install the SQL developer package as the following.
sudo apt-get install sqldeveloper-package debhelper openjdk-7-jdk
openjdk-7-jre icedtea-7-plugin
Now all that you need to do is to run the command (you might have a
different version)
make-sqldeveloper-package sqldeveloper-4.1.3.20.78-no-jre.zip
This will generate a debian package that you can use to install SQL developer.
Now install the resulting .deb package using the command (Your deb
might have a different version too)
sudo dpkg -i sqldeveloper_4.1.3.20.78+0.2.4-1_all.deb
In my case, I have used java 8.
3. Once you have done with your SQL developer installation on your newly created ec2 instance with VNCServer then all you need to do is to connect to that ec2 instance with the Remote Desktop Client by default available in your ubuntu local machine.
Use IP:1 with user/pass setup for VNCServer in #1
You can see the remote ec2 ubuntu desktop server. You have to grab the keyboard inputs from the Remote Desktop tool if you want to tab inside the remote server.
Once you get connected with the remote client, open SQL Developer from the terminal or from the explorer.
sqldeveloper
Follow the migration steps provided by Oracle corporation:
http://www.oracle.com/technetwork/database/migration/mysql-093223.html
Please Note: While following the migration steps provided by the
oracle they will ask for the destination database connection i.e. oracle
database connection. This is not the database where your MySQL
database will be migrated. Instead, this database connection will
be used for the migration process. Your database connection user
must have user and database create privileges. Once your connection
have user create privilege, then migration process automatically create
the corresponding database user in Oracle database[if you have mysql_test_db in MySQL
database, same mysql_test_db will be created in Oracle db too].
I recently used sqline's tool http://www.sqlines.com/cmd to convert a dump from mysql in the form of an .sql script to an (almost) Oracle-compatible sql script.
sqlines31113\sqlines.exe -s=mysql -t=oracle "-in=$infile"
I just had to (semi-manually) fix some things in the output and then I could run it on my oracle database.

Unable to Obtain Table Information in Enterprise Architect - MySQL

I'm using Sparx Enterprise Architect version 9.2 to import a database schema from a MySQL database using the ODBC connection. When I test the ODBC connection using the ODBC Data Source Administrator (Windows 7), the connection tests successfully. I'm using the MySQL ODBC 5.1 driver.
In Enterprise Architect when I try to use this ODBC connection to import the schema I get a message saying, "Unable to obtain table information".
Am I missing something? Any ideas?
The information provided by PsiX is helpful and relevant, but not the piece I was missing. The missing info can be found here, which applies even though it's talking about PostgreSQL (because it's being accessed through ODBC either way). Here is the pertinent information from the link above:
If you are using a 64-bit operating system:
• Enterprise Architect
requires 32-bit ODBC drivers to connect to a repository through ODBC;
to set up the ODBC configuration on 64-bit clients, run the 32-bit
ODBC Data Source Administrator from C:\Windows\SysWOW64\odbcad32.exe
• You can quickly load the correct 32-bit ODBC Data Source
Administrator by selecting Tools | ODBC Data Sources in the
Enterprise Architect menu bar
This piece of information was, unfortunately, omitted in the instructions for setting up Enterprise Architect for MySQL. (Too bad I hadn't noticed the option under Tools previously. Some of us have to do things the hard way!) Thanks again for the info provided by PsiX. It may be just what the next person needs so I'll give it an up-vote. :-)
Did you use the correct ODBC driver?
32 vs 64 bit is relevant here.
Did you check the two checkboxes as described in the installation of the driver?
(Select the Return matched rows instead of affected rows and Allow big result sets checkboxes.)
See here for a detailed description

Connect to MySQL database and fetch data in Julia

How can I fetch data from MySQL database in Julia?
It looks like this package provides tools for connecting to any database, including MySQL. However, it looks like assuming I have to first setup ODBC DSN to connect to it (I don't know what it is in the first place, although I've used MySQL for two years). So I tried to configure it by reading this page at MySQL documentation... but hit the wall immediately.
One, I can't find a command named myodbc-installer in my OS X 10.8.5. Two, there is no such application called ODBC Administrator, and instead there is ODBC manager in my system - So I think that documentation is too outdated... right?
Also, even when I opened ODBC manager and tried to click on Add on User DSN tab, there are no driver detected on the screen. So how can I configure ODBC DSN and make use of MySQL in Julia?
Also, do I have to deal with such a tedious setup process? I'd like to use a package, if any, that is as intuitive and easy to use as RMySQL package in R, which doesn't force me to care about DSN - any such package in Julia?
I'm on 0.2.0-rc in Julia and already installed the package through Pkg.add("ODBC"). MySQL version is 5.3.6 and installed via MAMP.
Thanks.
Jacob Quinn here, package maintainer for the ODBC package for Julia.
A few things to help you understand how the process works:
-ODBC is an API middle layer originally developed by Microsoft to create a common interface between DB systems and applications. This was useful because with the number of different DB systems, it would be hard to have applications that could reliably connect to any DB.
-ODBC has been ported to Linux/Unix/OSX systems through 2 main projects: iodbc (mainly OSX) and unixODBC (Linux)
-The basic components of the API are the ODBC Manager, which is the middle layer, the DB system, the application, and the ODBC driver, which is DB-specific and actually implements the communication between application-ODBC Manager and ODBC Manager-DB system.
-In the case of RMySQL, only the MySQL driver has been implemented with R wrapper functions which allow the connection to MySQL DB systems
-In the case of ODBC.jl (and the corresponding RODBC for R), a more generalized approach is taken where wrapper functions of the ODBC Manager are provided, which allow connection with any DB system, provided the user has the correct DB driver installed and connection string
Hopefully that helps understand the ODBC process a little better.
So for your case, it looks like you don't have the MySQL driver installed since it didn't show up in your ODBC Manager. You can find the driver here.
Once you have the driver installed, it should be pretty simple to set up a DSN (following either MySQL documentation or the excellent connectionstrings.com, MySQL Section).
You should then be able to start using ODBC in julia:
Pkg.add("ODBC")
using ODBC
ODBC.connect(dsn)
query("select * from customers")
If you run into any other issues or troubles getting things setup or installed, feel free to open an issue here and I'm more than willing to help troubleshoot the setup to get you going.

SQL Server sync to MySQL program

I want to continually sync every 30 mins or less around 380000 rows of data from 11 tables from a SQL Server database to a MySQL database. How can I do this? What programs can do this?
This post, which is often used to close questions like these as a duplicate, does not work for me, for the following reasons.
The SQL Server is part of a CRM system, I'm not sure if it may be a lite version or something, but long story short I do not have access to the SQL Server Management Studio.
The MySQL database is part of my hosting package, which means I have access to it via phpmyadmin and the like, but not to the console or anything. And obviously I cannot access it via localhost.
So basically what I'm looking for is a way to connect to both databases, probably via ODBC drivers, and sync data every x minutes/hours.
I finally used a program called Omega Sync. Now called Spectral Core Replicator.
Omega Sync can compare and synchronize both database schema and table data. Schema comparison and synchronization for databases of same kind
Data comparison and synchronization even for databases of different kind
Compare and Synchronize databases of unlimited size!
Supported databases
Access
SQL Server
MySQL
Oracle
Interbase
Firebird
ODBC sources
I am not associated with this company or product in any way.
Microsoft SQL Server replication can apply the changes to generic ODBC/OleDB subscribers. You can configure MySQL as a subscriber if you follow the right steps and use the correct drivers, but is not officially supported so you are on your own if something goes wrong. Eg. see Set up replication between Microsoft SQL Server 2000 and MySQL. since the article is for SQL 2000 is already deprecated since Microsoft SQL 2008 supports OleDB subscribers, not ODBC.
You will need a very deep understanding of both Microsoft SQL Server, MySQL, ODBC/OleDB and Microsoft SQL Server replication. If you hit errors you'll have to solve them on your own, as the public information on this subject is scarce. I can only tell you that is possible and I've seen it done. Good Luck!