Page History
Table of Content Zone | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||
How do connection names resolve to IP's?It does not answer questions about the SQLyog SQL DM program as such. But we experience quite often that SQLyog SQL DM user having problems in getting the connection to one ore more MySQL servers working are missing the basic understanding of the TCP protocol that is used for connection. So this is a 'background article' that supplements the more typical FAQ items here.
So to access a MySQL server (running on the standard MySQL port 3306) on the ip v.x.y.z the client must ask for connection to the server 'v.x.y.z:3306'. The Internet can handle this. This is the basically how the Internet and the TCP-protocol works! Pretty simple actually! And there is one basic rule more: the ip 127.0.0.1 is always any computer itself! However you probably never enter internet addresses that way no matter if it is a website, an FTP-server or a MySQL-server that you access. You use NAMES. However these names must be resolved to the above format. If not resolved to ip's the servers on the Internet can't handle the request. There are basically four ways of resolving a name to an IP(and in that order):
1. Client hosts' file
You might find more lines too - for several reasons: some viruses and spyware add items to the hosts file. Some users and Sys Admins do it on purpose. But since you are able to connect to a MySQL server running on your local machine with the host name 'localhost' it is because of the above line in the hosts file. The hosts files resolves the name 'localhost' to ip 127.0.0.1. If you prefer to use 'cutie' instead of 'localhost' then just add the line
to your hosts file! A typical exampleYou connect to a remote server with the host name mydb.thisismyisp.com. What happens here? Simply:
After following the previous steps mydb.thisismyisp.com is resolved to ip v.x.y.z on the internet and IP a.b.c.d on the remote network. Once connection is established the routers and other networking gear in the complete communications chain keeps that information until it is closed or times-out due to inactivity (or some error occur). One more detail, when connecting to the MySQL server at an ISP it is common practice that MySQL user names and MySQL database names must be prefixed with the domain user name (the one that is used for FTP for instance). Like me_username and me_mydb. Simple because other users may have created a MySQL user username and a MySQL database mydb. But failure to do so does not result in a connection error, but an authentication error. Also note that MySQL usernames can be up to 16 characters long only, review the error "I have a very long username for the MySQL database at my ISP. SQLyog SQL DM won't let me use it" that is listed below. Nevertheless, everything can get 'messed up' if it is the first time you try to connect to a remote MySQL server! And here tunneling is not involved. What should I enter as 'hostname' when connecting to a MySQL server at an ISP.It depends on the systems and the network settings at your ISP. The systems that ISP's operate are too numerous to mention. Some operate almost all their server programs on one very powerful (UNIX-) machine, others operate a network of many computers that are basically PC-type hardware. Some use Linux/Unix operating systems other Windows server systems (and some mix it!). And ISP's vary in size from 200 customers to 2.000.000. They can't all operate the same systems!
If the ISP has the domain name thisisanisp.com then with direct connection you will use mysqlserver.thisisanisp.com.
With HTTP-tunneling 'host' can simply be 'mysqlserver' (ie: 'mydb1' or 'mysql' or whatever). mysqlserver.thisisanisp.com will work too, but there is no need for an extra domain lookup! If it is the same computer that runs the Web-server (with PHP-interpreter) and the MySQL server it can also be 'localhost' or the ip '127.0.0.1'. PHP will connect to MySQL through a Unix-Socket if 'localhost' is specified and TCP if '127.0.0.1'. Both will normally work. TCP may be a little bit slower on Linux machines than Socket, so you can try 'localhost' first. However there are situations where 'localhost' will return an error like error: 'Error No. 2013: Lost connection to MySQL server during query'. This is likely because PHP looks for the socket file where it does not exist. The underlying reason could be that MySQL and PHP have been installed from different repositories using different file positions for the socket file and the mysql datadir.
With SSH-tunneling there are two hosts' settings:
Do I need PHP to use SQLyog with MySQL?No. You do not need PHP or any PHP-based tool like phpMyAdmin. All you need is MySQL and SQLyog. But of course if you want to use your MySQL database with a website you must use a scripting language (PHP, ASP or JSP for instance)and the corresponding "preprocessor" must installed with the web(HTTP-)server. That is because a webserver without such extension is not able to connect to MySQL and interpret data from a database. However - you can continue to use SQLyog and the SQLyog Job Agent (SJA) for administering your databases and for performing database maintenance, data import, and synchronization with other MySQL databases etc., no matter which other type of connections are made to the database. Even if the TCP-port (3306) normally used by the MySQL server is blocked (as often is the case at ISP's) SQLyog still let you connect using HTTP(s)-tunneling or SSH-tunneling. SQLyog gives you the most options for connecting to MySQLSQLyog connects to MySQL using the native C-API from MySQL - the fastest and most effective way to manage MySQL. This API is compiled into SQLyog code itself. Even if the TCP-port (3306) normally used by the MySQL server is blocked (as often is the case at ISP's) SQLyog still let you connect using HTTP(s)-tunneling or SSH-tunneling. And if you are behind a proxy SQLyog can handle that too. The client for SSH connection is installed with SQLyog, and a PHP-script for HTTP-tunneling is too. That script must be uploaded to your webhost. The PHP-script uses php_mysql extension that is available practically everywhere where MySQL is available. SQLyog works with MySQL version 3.23 and upwards. SQLyog takes long time to connect when using SSH-tunnel.If SQLyog is taking long time (more than 5-10 seconds) to connect to your MySQL server using SSH tunneling then there could be problem with the name resolution. What Is SSH and SSH-tunneling?The Acronym SSH stands for Secure Shell Host. SSH was originally created to provide a secure way to access server systems at "low level", to be used instead of common (but insecure) telnet methods. SSH can use several different forms of encryption, anywhere from 56 to 1024 bit. SSH has been ported to Operating Systems on several platforms including Linux, Microsoft Windows and Macintosh. There are SSH servers and SSH clients available for different types of communication. Here you may notice this: "OpenSSH includes the ability to forward remote TCP ports over a secure tunnel, allowing that way arbitrary TCP ports on the server side and on the client side to be connected through an SSH tunnel". This is excatly what we make use of.The term "SSH tunneling" in relation to a database server means that in- and outgoing communications to the network that hosts the database server "passes through" the SSH-server and uses the communications port (usually port 22) and the protocol of the SSH-server. The SSH-server then "translates" and "transfers" that in-and outgoing communication to the database server. SSH is actually quite simple to use. However if you are totally unfamiliar with networking terminology you will have to study it somewhat. Actually you may even install an SSH server at your own local machine and use it for connecting to a local MySQL server. Not much use of that, but it will give you an excellent understanding of what SSH is!There is a built-in SSH-client in SQLyog that lets you connect to a MySQL server using SSH. Basically there are two benefits of SSH Tunneling: * SSH can be used to encrypt communications between SQLyog and your remote MySQL server. * It lets you access the MySQL server even if the MySQL port (3306) is blocked. Unlike HTTP-tunneling, you cannot take it for granted that SSH-tunneling is available at your webhost. In general the "more professional" and "more expensive" hosting providers offer SSH and the cheaper ones don't. Refer to the SQLyog help file for instructions how to set up the SQLyog Connections Manager, if you want to use SSH-tunneling with SQLyog. Each SSH-connection occupies a TCP-port at your local machine. With recent SQLyog versions this port is picked automatically from the pool of high-numbered ports not already in use. A concluding note on the popular 'Putty' program and SQLyog SSH-tunneling. Sometimes when people are having problems with SSH-connections, we often hear "I can connect with Putty without problems". Maybe so, but it does not tell very much (almost nothing actually!) because the type of connection with Putty or a similar program referred to here by users is not tunneling and does not make use of port forwarding. Putty creates a remote (and secure) shell on the client machine, and connects to the 'mysql' client program on the server. So here the MySQL client is the 'mysql' client on the remote server. It is true that Putty can be used for setting up a SSH-tunnel as well, but this is not the simple 'connect with Putty' most often referred to and compared with here. With (SQLyog) SSH-tunnel the MySQL client is the client API that is compiled into SQLyog (and SJA). That is why port forwarding is needed and must be functional with SQLyog SSH-tunneling! You can review the SSH-related error messages
Connection Issues |
Expand | ||
---|---|---|
| ||
I have a very long username for the MySQL database at my ISP. SQLyog won't let me use it.Right! Because a MySQL user name is up to 16 characters long. The MySQL docs clearly state:
However, it is a bad practice with some ISP's that they generate longer usernames than that. It is typically 'cheaper' hosting providers that offer a single MySQL database as part of a 'personal' or 'small business' subscription plan. They auto-generate the username from the user's domain name and it could be somewhat like mydb_myveryowndomain or similar. It is also true that some of our competitors offer support for that. However it is very bad practice! To make it work you will have to:
We have had intense discussions with this the MySQL AB on this issue. From the official correspondence we quote: "This is simply a lucky fluke of sorts (if it works). MySQL simply does not support longer usernames .... Altering the system tables, aside from using our own mysql_fix_privilege_tables script to keep up with our changes, is simply unsupportable. There are server and client changes needed to properly handle any sort of modifications here, even though in some cases a quirk (as above) may seem to function .... This is, basically, dangerous behavior. We will attempt to curb it as well as we can.... Luckily, our manual states clearly that in both cases, MySQL will not provide support if any problems arise ... That is , it may work and it may not work, but MySQL will not ponder as to why it works or why it does not work ... We simply do not provide support for such cases." We won't play that game as others do! You should convince your ISP that changing the format of the user table is bad and dangerous practice! And further: MySQL has 'stopped the game'. Again we quote from the above correspondence: "To make things even more precise, I will now send a server patch to our development management. This patch adds a code that will truncate user column at 16 chars and other columns to their nominal sizes. This will ensure that future 4.1 and 5.0 versions will not work with longer names, whatever changes some application could envisage." So with the most recent builds in the MySQL 4.1.x series and with MySQL 5.0 it would not work anyway. There is now code in the server binary itself that truncates any user name to 16 characters. |
Expand | ||||||
---|---|---|---|---|---|---|
| ||||||
I get Error Nº 2002. Can't connect to local MySQL server through socket ...This can occur when connecting using HTTP-tunneling to a MySQL server running on Unix/Linux platforms. MySQL writes
How to cope with this would depend on which webserver and which php version is used. But here is a workaround that has worked with Apache: |
SQL DM gives you the most options for connecting to MySQLSQL DM connects to MySQL using the native C-API from MySQL - the fastest and most effective way to manage MySQL. This API is compiled into SQL DM code itself. Even if the TCP-port (3306) normally used by the MySQL server is blocked (as often is the case at ISP's) SQL DM still let you connect using HTTP(s)-tunneling or SSH-tunneling. And if you are behind a proxy SQL DM can handle that too. The client for SSH connection is installed with SQL DM, and a PHP-script for HTTP-tunneling is too. That script must be uploaded to your webhost. The PHP-script uses php_mysql extension that is available practically everywhere where MySQL is available. SQL DM works with MySQL version 3.23 and upwards. SQL DM takes long time to connect when using SSH-tunnel.If SQL DM is taking long time (more than 5-10 seconds) to connect to your MySQL server using SSH tunneling then there could be problem with the name resolution. What Is SSH and SSH-tunneling?The Acronym SSH stands for Secure Shell Host. SSH was originally created to provide a secure way to access server systems at "low level", to be used instead of common (but insecure) telnet methods. SSH can use several different forms of encryption, anywhere from 56 to 1024 bit. SSH has been ported to Operating Systems on several platforms including Linux, Microsoft Windows and Macintosh. There are SSH servers and SSH clients available for different types of communication. Here you may notice this: "OpenSSH includes the ability to forward remote TCP ports over a secure tunnel, allowing that way arbitrary TCP ports on the server side and on the client side to be connected through an SSH tunnel". This is excatly what we make use of. There is a built-in SSH-client in SQL DM that lets you connect to a MySQL server using SSH. A concluding note on the popular 'Putty' program and SQL DM SSH-tunneling. Sometimes when people are having problems with SSH-connections, we often hear "I can connect with Putty without problems". Maybe so, but it does not tell very much (almost nothing actually!) because the type of connection with Putty or a similar program referred to here by users is not tunneling and does not make use of port forwarding. Putty creates a remote (and secure) shell on the client machine, and connects to the 'mysql' client program on the server. So here the MySQL client is the 'mysql' client on the remote server. It is true that Putty can be used for setting up a SSH-tunnel as well, but this is not the simple 'connect with Putty' most often referred to and compared with here. With (SQL DM) SSH-tunnel the MySQL client is the client API that is compiled into SQL DM (and SJA). That is why port forwarding is needed and must be functional with SQL DM SSH-tunneling! You can review the SSH-related error messages. Connection Issues |
Expand | ||
---|---|---|
| ||
I have a very long username for the MySQL database at my ISP. SQL DM won't let me use it.Right! Because a MySQL user name is up to 16 characters long. The MySQL docs clearly state:
However, it is a bad practice with some ISP's that they generate longer usernames than that. It is typically 'cheaper' hosting providers that offer a single MySQL database as part of a 'personal' or 'small business' subscription plan. They auto-generate the username from the user's domain name and it could be somewhat like mydb_myveryowndomain or similar. It is also true that some of our competitors offer support for that. However it is very bad practice! To make it work you will have to:
We have had intense discussions with this the MySQL AB on this issue. From the official correspondence we quote: "This is simply a lucky fluke of sorts (if it works). MySQL simply does not support longer usernames .... Altering the system tables, aside from using our own mysql_fix_privilege_tables script to keep up with our changes, is simply unsupportable. There are server and client changes needed to properly handle any sort of modifications here, even though in some cases a quirk (as above) may seem to function .... This is, basically, dangerous behavior. We will attempt to curb it as well as we can.... Luckily, our manual states clearly that in both cases, MySQL will not provide support if any problems arise ... That is , it may work and it may not work, but MySQL will not ponder as to why it works or why it does not work ... We simply do not provide support for such cases." We won't play that game as others do! You should convince your ISP that changing the format of the user table is bad and dangerous practice! And further: MySQL has 'stopped the game'. Again we quote from the above correspondence: "To make things even more precise, I will now send a server patch to our development management. This patch adds a code that will truncate user column at 16 chars and other columns to their nominal sizes. This will ensure that future 4.1 and 5.0 versions will not work with longer names, whatever changes some application could envisage." So with the most recent builds in the MySQL 4.1.x series and with MySQL 5.0 it would not work anyway. There is now code in the server binary itself that truncates any user name to 16 characters. |
Expand | ||||||
---|---|---|---|---|---|---|
| ||||||
I get Error Nº 2002. Can't connect to local MySQL server through socket ...This can occur when connecting using HTTP-tunneling to a MySQL server running on Unix/Linux platforms. MySQL writes
How to cope with this would depend on which webserver and which php version is used. But here is a workaround that has worked with Apache: |
Expand | ||
---|---|---|
| ||
Error no. 1251: "Client does not support authentication..."Error no. 1251: "Client does not support authentication protocol requested by server - consider upgrading MySQL client" occurs when the hashing-method for storing password used by the client differs from the one of the server. Typically it occurs when trying to connect to MySQL 4.1 or 5.x with a client compiled for 3.x or 4.0. The Client as far as SQL DM goes is either the IderaSQLdmforMySQL-8.7.0-0.exe and sja.exe executable files (with its compiled-in MySQL C-API) or - in case you use HTTP-tunneling - your PHP-binary. SQL DM itself (the IderaSQLdmforMySQL-8.7.0-0.exe -executable) handles all MySQL versions from 3.23.x and | ||
Expand | ||
| ||
Error no. 1251: "Client does not support authentication..."Error no. 1251: "Client does not support authentication protocol requested by server - consider upgrading MySQL client" occurs when the hashing-method for storing password used by the client differs from the one of the server. Typically it occurs when trying to connect to MySQL 4.1 or 5.x with a client compiled for 3.x or 4.0. The Client as far as SQLyog goes is either the sqlyog.exe and sja.exe executable files (with its compiled-in MySQL C-API) or - in case you use HTTP-tunneling - your PHP-binary. SQLyog itself (the sqlyog.exe -executable) handles all MySQL versions from 3.23.x and upwards automatically, and the error message should not occur with direct connection. In case you experience the error when HTTP-tunneling, you can EITHER replace the PHP-binary OR downgrade the hash-type for the user used for tunneling (and other PHP based connections) with the following command: SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd'); The command must be written as it is. At ISP's you should expect the Sys Admin there to have MySQL-installations and PHP-binaries that "fit". If you operate your own MySQL server the hashing method may or may not change when upgrading the server from 4.0 to a newer version. That depends on the upgrade method. This one is very similar to "Error no. 1045: Connection denied ..", which you can find it in this list. However, this case connection is established OK but access to data is denied. The user exists but most like he does not have any privilege at all. About user privileges start, please refer to the issue "I am able to connect but can't see the list of databases/tables" listed in this page. |
Expand | ||
---|---|---|
| ||
I am able to connect using phpMyAdmin, butSQLyogSQL DM will not let me connect.PhpMyAdmin is running on the server itself so when connecting to MySQL with phpMyAdmin you are NOT connecting from a remote host! With SQLyog SQL DM you are connecting from a remote host. This is a very important difference as far as user configuration with MySQL is concerned. The user that you are connecting with maybe has no privilege to connect from remote. |
...
Expand | ||
---|---|---|
| ||
I am getting "Protocol Mismatch; Server Version 9; Client Version 10"The protocol version 9 is used by MySQL 3.22 and earlier. The current version of SQLyog SQL DM supports 3.23.x and above. To use it with 3.22 we have to provide you with a special build of SQLyogSQL DM. Registered users can request such copy from ideramysqlsupport@idera.com. We can not guarantee that it will be the latest version of SQLyogSQL DM. The opposite error message appears if you try to connect from an application with a connector (for instance an ODBC-driver) that is too old too be used with the actual MySQL version. |
Expand | ||
---|---|---|
| ||
I have an account with Yahoo. Can I useSQLyog…SQL DM…Yes. But several users have had problems getting connection parameters right. Here is what Yahoo say themselves: Why can't I access my database? You will need to use HTTP Tunneling. First upload SQLyogTunnelSQL DMTunnel.php (available with the SQLyog SQL DM installer). Put the correct URL in the HTTP Tunneling field and use the same credentials as you use in your PHP pages. The Hostname should be "mysql" (case-sensitive). |
Expand | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
I get error 1130 "Host is not allowed to connect ..." or "Access denied ..." or "Could not connect ..."Error 1130 is a networking error. The server cannot resolve the hostname of the client. Or the host is not allowed to connect to the MySQL server. There are basically 2 categories of possible reasons:
In MySQL a user a user is specified using BOTH the user name and the host from where the user may connect. If no user has been created where the host-part (using wildcards or not) mathces the host of the client trying to connect MySQL returns this error.
When upgrading to MySQL 5.7.3 from a previous version this may occur due to changes to the user table introduced in 5.7.3. There is a good blog about it,
|
Expand | ||
---|---|---|
| ||
Error no. 1045: "Connection denied..."The error message: Error No. 1045: Connection denied for 'someuser@somehost' (using password: YES/NO) It is a user authentication error. The user details specified do not "match" the user tables of the specified MySQL server. Common situations are:
NOTE: MySQL does not use the OS's or domain's user's management. It operates its own user accounts. With a fresh MySQL installation the user ROOT is created with NO PASSWORD. When working with MySQL databases at ISP's an admin user most often must be activated from some web based Control Panel Application before connection to the MySQL server is possible. There could be more "rules" applying here (database and user naming conventions etc). Refer to the docs/support at the ISP for details on that. We can't give them!
SET PASSWORD FOR some_user@localhost = OLD_PASSWORD('newpwd'); (where some_user@localhost is the user used for this connection) since the format for storing passwords has changed between 4.0.x and 4.1.x versions. |
Expand | ||
---|---|---|
| ||
Error No. 2005: Unknown MySQL server host...The error message: Error No. 2005: Unknown MySQL server host 'some_URL_or_ip' Simply means that connection is not possible for the following (or similar) reasons: A protocol is specified in the "MySQL host address" field of the SQLyog SQL DM Connection Manager that does not support MySQL connection. It is a common mistake among beginners to use "http://...", instead of just "www.myveryowndomain.com" or "sales.myowncompany.biz" or "localhost" (if the webserver and the MySQL server is running on the same computer). When connecting to a remote network you may need to ask the Sys Admin there for the correct URL to use for addressing the MySQL server. However if you use HTTP-tunneling the URL-field on the Tunnel -tab of the SQLyog SQL DM Connection Manager should be a complete URL with the "http://" protocol specified. This is because the tunneling script must be addressed through a webserver (that is the idea of HTTP-tunneling!). |
Expand | ||
---|---|---|
| ||
Error no. 2003: Cannot connect...The error message: Error No. 2003: Can't connect to MySQL server on 'localhost' (or some other host) Simply means that connection is not possible for one of the following (or similar) reasons:
|
Scroll pdf ignore | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
webyog Newtabfooter |
Newtabfooter |
Newtabfooter |
Newtabfooter |
Newtabfooter |
Newtabfooter |
| ||||||||||||||||||||||||||||||||||||||
Newtabfooter | ||||||||||||||||||||||||||||||||||||||||||||
|
|
about/aboutus
| Newtabfooter alias Legal url https://www.idera.com/legal/termsofuse
IDERA Website | Products | Buy | Support | Community | About Us | Resources | Legalabout/aboutus |
alias | Legal |
---|---|
url | https://www.idera.com/legal/termsofuse |