Test SQL Server Express connectivity using mysql? - 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).

Related

How to know where my MySQL database is being hosted and how can I access it?

I have the following information to a SQL database
Server : MyUserName.mysql.db
User : MyUserName
Password : MyPassWord
I am a little noob in this context, so I have some questions:
How to know where is hosted my database? Is it in mysql domain? (Isn't that the type of database?)
How can I access it and visualize it?
To begin with, you need a CLIENT to be able to access your database. For MySQL, you can use either Workbench or MySQL CLIENT (the last giving you command-line level access).
Second, and according to your information, the server is MyUserName.mysql.db so if you try to PING that server you should get some response.
Third, MySQL has a default port number so you need to configure your client to access that server though that port (if I'm not mistaking, 3306).
You will also need access credentials to your database.
Your DB administrator should be able to provide all the information you need.
Contact your database administrator.
If you're trying to acess/visualize sql server database on your local computer install ssms to connect to your local database , similarly you can access any other database through ssms.

Linked server requires no encryption

I'm trying to replicate a Linked Server from a Windows 2k3 / SQL Server 2000 to a Windows 2008 / SQL 2008 R2 setup.
The SQL 2000 Linked server is setup like this:
srvname=blah.blah.com
srvproduct=SQL Server
providername=SQLOLEDB
datasource=blah.blah.com
srvnetname=blah.blah.com
rpc=1
rpcout=1
dataaccess=1
The SQL 2008 R2 Linked Server is setup the same way.
I've copied the remote users, and all seems fine, except when i tried to connect, I get this error:
OLE DB provider "SQLNCLI10" for linked server "blah.blah.com" returned message "Client unable to establish connection". (Microsoft SQL Server, Error: 20)
Encryption not supported on SQL Server
I still have access to the SQL 2000 machine, and can run the query fine. I'm guessing the issue is that Windows2008 machine is trying to send data encrypted, but the linked server is saying it can't handle encryption. Something along those lines. I've played with various different Data Source types, and nothing seems to pan out. I don't have access to the remote server so I don't know what OS/Database is on it.
Anyone with more SQL knowledge than me can point me in the right direction?
Thanks!
Hooray! I've done it. For anyone that may find this issue in the future, this is what I did:
Create ODBC connection to SOMESERVER.COM, call it dsnSOME
Driver: SQL Server
Name: dsnSOM
Server: SOMESERVER.COM
Create a Linked Server to dsnSOM:
Linked server: "SOMESERVER" (I don't think it matters)
Provider: Microsoft OLE DB Provider for ODBC Drivers
Product Name: dsnSOME
Data source: dsnSOME
And that's it. Now when I call the stored procedure I call:
[SOMESERVER].database.owner.storedprocedure
And it works!
It seems that for whatever reason, when trying to run a stored procedure on SQL 64 bit to a SQL 32 bit linked server directly, it gives this weird message about Encryption. However going through the ODBC and it works great.

Trying to migrate SQL Server to MySQL using MySQL Workbench. Error: "[Microsoft][ODBC Driver Manager] Invalid argument value" when migrating data

Long time lurker, first time poster; hoping anyone can help me out.
Im using MySQL Workbench 5.2.41 to migrate a database from SQL Server to MySQL 5.0.8
The entire process goes smoothly: both SQL and MySQL connection Tests are good, the skemea and table create as expected, everything checks out until the 'Bulk Data Transfer' step. At that point I receive this error:
...
Migrating data...
wbcopytables.exe --odbc-source=DSN=SQL Server 11;DATABASE=;UID=sa --target=root#127.0.0.1:3306 --progress --passwords-from-stdin --thread-count=1 --table [GSAClosers_v2] [dbo].[AccountBase] `dbo` `AccountBase`
`dbo`.`AccountBase`:Copying 84 columns of 169530 rows from table [GSAClosers_v2].[dbo].[AccountBase]
ERROR: `dbo`.`AccountBase`:SQLGetData: HY009:10:[Microsoft][ODBC Driver Manager] Invalid argument value `dbo`.`AccountBase`:
Finished copying 0 rows in 0m00s
Copy helper has finished
...
For connectors I'm using Microsoft SQL Server / ODBC Data Source / DSN: SQL Server and for MySQL the IP and port(3306).
SQL Server 2012 Management Studio connects and all operations work as expected.
O, side not: both are on the same localhost machine.
If anyone can shed some light on this I would be forever indebted. Thanks in advance
From here:
[Microsoft][ODBC Driver Manager] Invalid argument value.
Regarding to the error message and code you provided, which seems is
database is invalid or cannot be accessed. That means either the
database does not exist or the user does not have permission to access
the database.
It turns out you need specify the instance after the server name, so
in the server name in the dialog box for creating the ODBC Data
Source, you must enter it as either: MyServer\SQLEXPRESS or
.\SQLEXPRESS
I think you may have a problem connecting to your database from wbcopytables.exe. Keep in mind that this is a separate tool so the fact that you can connect from the rest of the Migration Wizard doesn't imply that you will connect in wbcopytables.exe.
The thing that worries me the most is that your DSN has whitespace characters. This might be interpreted by the Windows terminal as independent command line parameters. One thing you can do is to edit your DSN name removing the whitespaces and try again.
You may also want to connect without a DSN by putting all your connection parameters explicitely as explained in my blog post: How-To: Guide to Database Migration from Microsoft SQL Server using MySQL Workbench.
And, by the way, since MySQL Workbench 5.2.42 is out you should go and get it. The Migration Wizard is pretty new so important bug fixes are likely launched in each recent Workbench release.
In either case I think you should file a bug with your issues with a detailed explanation about how to reproduce it, possible solutions, etc.
Hope this helps.
Ok, got it figured out: un-install java. install java 1.6, use MySQL Migration Tool. change all data types to varchar, ints and bits. run migrations....eat data.

MySQL connection error

When I am trying to use SQLyog to connect to my MySQL database, it is giving the error like
Error No. 2005
Unknown MySQL server host 'database.ch3.s.com' (11004)
Any idea what can be the issue?
Have you tried pinging the hostname, go to the command prompt and type 'ping database.ch3.s.com'
I have found scenarios where the database hostname is not available to external connections (ping will fail) but it works on the server. In this case you simply can't create an external connection to the database and will have to use the servers phpMyAdmin or equivalent.
Databse server may be down or there might be a proxy server which can prevent you to access the DB server.
The address of the MySQL databases seems to be invalid. The address 'database.ch3.s.com', is this a subsitute or is this the real address you are using?

SQL Server Error 223 When Connecting

I recently changed SQL Server 2008 from windows authentication mode, to mixed. I created a new user 'taraw' and set a password. I'm connecting to localhost - which works perfect when using windows authentication, however if I want to use SQL Server authentication with my user - taraw, I get the following error:
Shared Memory Provider, error: 0 - No
process is on the other end of the
pipe (Microsoft SQL Server, Error 233)pipe (Microsoft SQL Server, Error 233)
I know the password is correct as I've just created it, I've also tried creating different users, to which I get the same result. I've read somewhere that Namespipes might be disabled? But I haven't found out where or even how to enable this. (EDIT: I have since found this, and it is enabled)
If anyone has any advice it would be MUCH appreciated.
Thanks
I have since solved this problem. I was previously restarting the server within SQL SERVER MANAGEMENT STUDIO, this was incorrect.
I simply restarted the SQL Server within SQL Server Configuration Manager and it worked.