SSMA: Migration fails MySQL -> Azure SQL with no error - mysql

I am getting this error when I attempt to migrate from MySQL localhost DB to Azure SQL using MMSA (SQL Server Migration Assistant) for MySQL
I have seen this around https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b835f4b3-3d93-42a4-9b6b-d21d3dfd8dab/ssma-error-migrate-data-mysql-sql-server?forum=sqlservermigration
Some suggestions are change MySQL connection from ANSI to unicode, make sure all db names are lowercase. Both do not work.
Any ideas?

Related

Failure to connect to MySQL server from SQL Server Migration Assistant

I have SQL Server 2017 Developer installed. I want to use the SQL Server Migration Assistant for MySQL to migrate a MySQL database into SQL Server. But I can't get the migration assistant to connect to the MySQL server. First of all, using MySQL Workbench I can connect to the server with no problem through this dialog box;
MySQL Workbench connection dialog box
Using the same service, (or server) name, port and user entered into the migration assistant dialog box for connecting to the MySQL server;
SQL Server Migration Assistant connection to MySQL Server dialog box
I get an error message saying,
Cconnection to MySQL failed. ERROR [HY000] [MySQL][ODBC 5.2(w) Driver]Unknown MySQL server host 'Mysql#127.0.0.1' (0)
I've tried selecting both the ANSI and unicode ODBC drivers, version 5.2 and 5.3. Nothing seems to work.
You need to remove "Mysql#" from the connection string. This isn't a necessary part of the hostname when connecting through SSMA.

Cant connect to Azure MySQL through MySQL workbench

I have set up an Azure SQL server and database. In the dashboard, I am selecting the SQL Database to copy the server name (xxxxxx.database.windows.net).
I am creating a new connection in MySQL workbench and putting this servername as host.
The port I am putting is 1433.
After entering username and password, I am testing the connection. I am getting the following error, as the connection is not getting established between my database/server on Azure and workbench. The error is:
Lost connection to MySQL server at 'reading initial communication packet', system error:104
Any suggestions on making me understand why is it happening and how can the connection be made will be highly appreciated.
Your post is confusing, are you using Azure SQL Database or Azure Database for MySQL? The name format "xxxxxx.database.windows.net" is for Azure SQL Database, which you should not use MySQL workbench to connect. I'd suggest you switch to SSMS and try again.

Connecting Scala and Play-Slick to AWS MySQL

Having difficulty connecting to AWS MySQL database in a new Scala Play Slick application. I can connect to the database from MySQL Workbench.
application.conf contains:
db.default.user=myusername
db.default.password=mypassword
db.default.driver=com.mysql.jdbc.Driver
The problem may be in db.default.url=
The MySQL Workbench copy JDBC connection string command yields:
"jdbc:mysql://sperch-dev.coafgaprx2uf.us-east-1.rds.amazonaws.com:3306/?user=myusername"
Including the "user=" here as MySQL Workbench suggests seems redundant with db.default.user and anyway I get the error message "[SQLException: No database selected]" with or without it.
Having seen elsewhere the pattern for db.default.url as:
"jdbc:mysql://localhost:3306/DATABASENAME?characterEncoding=UTF-8"
I tried adding the database name:
"jdbc:mysql://sperch-dev.coafgaprx2uf.us-east-1.rds.amazonaws.com:3306/sperch-dev?characterEncoding=UTF-8"
That however generates the error message:
"Cannot connect to database [default]"
My db.default.user and db.default.password are the same as the working connection in MySQL Workbench.
Any suggestions?
Remove the Port number and user name from the db.default url. Below is an example of what works.
# Database configuration
db.default.driver=com.mysql.jdbc.Driver
db.default.url="jdbc:mysql://your-rds-instance.us-west-1.rds.amazonaws.com/DATABASE_SCHEMA_HERE"
db.default.user=user
db.default.pass="password"

Test SQL Server Express connectivity using mysql?

Apologies - this is a bit of a newbie (I'm not a DBA)
Question: I'd like to test remote access to MS SQL Server Express from a linux box using MySQL. Is there any additional configuration required on the SQL Express side?
If I'm testing access to another MySQL database I can just to the following:
mysql --host ip_address --port=3308 --user=username -p
Then after entering my password I can get my remote "mysql>" prompt.
I guess my question is this - is there an equivalent way to test connectivity to MS SQL Server Express remotely? Can I connect to an MS Sql Server in this way or do I need to provide instance name or specific Db perhaps?
Thanks in advance!
I should also mention that current attempts to do this result in an error even if trying ports 1433/1434/1521 instead of 3308:
ERROR 2003 (HY000): Can't connect to MySQL server on 'ip_address' (111)
It seems to be assuming connection to another MySQL server by default.
I believe error 111 means "connection refused" so I'm thinking this might be a MS SQL Server configuration problem? I'm assuming this is a SQL-generated error.
Actual SQL may be more-or-less standard across DBMS's, but the way you actually talk to them individually is quite different: there isn't even a standard for them to deviate from!
Your mySQL client is trying to talk to a MySQL database server, and sending information the a MySQL server would expect. This is being received by a SQL Server database server which expects something quite different, and is saying effectively "Talk sense! No? Go away."
What actually talks to the database usually is the driver you select. This is how e.g. C# code on Windows can talk to many different database servers: you provide the right driver and specify it in the connection string. I have no idea whether a SQL Server driver exists for Linux, nor how you can specify the driver to your mySQL client. You'll have to get both working somehow.
The good news is that Linux drivers do exist for SQL Server e.g. here. That still leaves how you tell the mySQL client to use it (which I'm not sure would be possible).

Setting up Liquibase with MS-SQL Server

I am utilising Liquibase (www.liquibase.org) into our MVC3 SQL Server 2008 project to manage database migration/changes. However I'm stumbling on the first hurdle: Connecting to Microsoft SQL Server instance.
I am looking at the quick start tutorial on the liquibase site, but exchanging the mysql for sql server DB
I run this command:
liquibase --driver=sqljdbc.jar --changeLogFile="C:\Temp\ChangeLog.xml" --url="jdbc:sqlserver://localhost;databaseName=test" --username=user --password=pass migrate
And receive this error:
Liquibase Update Failed: Cannot find database driver: sqljdbc.jar
I have tried adding --classpath pointing to the sqljdbc driver with no luck.
How can I create or update an MS-SQL Server database with liquibase?
Create a properties file called liquibase.properties containing the following:
classpath=C:\\Program Files\\Microsoft SQL Server 2005 JDBC Driver\\sqljdbc_1.2\\enu\\sqljdbc.jar
driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
url=jdbc:sqlserver://localhost:1433;databaseName=test
username=myuser
password=mypass
changeLogFile=C:\\Temp\\ChangeLog.xml
liquibase will use this file when located in the same directory. Useful to simplify the command-line.
Database is updated as follows:
liquibase update
Notes:
I'm not a SQL server user, I picked up the JDBC driver and URL details from Microsoft doco
The "migrate" command has been deprecated.