Cant connect to Remote MySQL Server
| User, date | Message |
|---|---|
|
Written by Deluxe23
6 years ago Category: Creating a connection 1 posts since Sun, 29 Apr 07 |
Hi, I cant connect to a Remote MySQL Server with HeidiSQL. First of all, the target server is from a Hosting-Provider. I have access via PHPMyAdmin, so I suppose, I dont have a username oder password problem. I'm always getting the following error message: Could not establish connection! Details: SQL Error: Access denied for user: webXXX@p15152122.dip0.t-ipconnect.de (Using password:YES) webXXX is the same username for the login via PHPmyAdmin In the field Hostname, im using directly the Server-IP-Address In PHPMyAdmin I found this information: Server: Localhost via UNIX socket Benutzer: webXXX@localhost skip external locking ON skip networking OFF I only have access to my default user database in PHPMyAdmin. I find some similiar postings, but they didnt help me. Are there something specfic values, that needed to be added in the connection windows ?! Thanks a lot! |
|
Written by siMKin
6 years ago 104 posts since Sun, 01 Apr 07 |
you should check with your host that remote access is allowed PHPMyAdmin runs (most likely) on the same server and therefor connects through the localhost when you connect from your computer however, you connect from outside which can cause all sorts of problems. two most likely ones: 1. the server's firewall blocks your ip from port 3306 (the database port) 2. mysql simply doesn't allow remote connections for your username but this is something only your host can tell you |
|
Written by ansgar
6 years ago 3958 posts since Fri, 07 Apr 06 |
Deluxe23 wrote: SQL Error: Access denied for user: webXXX@p15152122.dip0.t-ipconnect.de (Using password:YES) Did you check this: http://dev.mysql.com/doc/refman/5.0/en/access-denied.html ? |
|
Written by ansgar
6 years ago 3958 posts since Fri, 07 Apr 06 |
I'm nearly 100% sure your user has to be changed to allow connections from host "%", not only from "localhost" or "127.0.0.1". If you have the needed privileges to do so you can do that by using the existing phpMyAdmin. Locate your username in the table mysql.user, change the hostname to "%" (without quotes) and fire a "FLUSH PRIVILEGES". After that you should be able to use HeidiSQL on this server. |
|
Written by siMKin
6 years ago 104 posts since Sun, 01 Apr 07 |
And should you have the privileges to do so, complain to your hostingprovider about the security. If you can do this, any other customer can do it too ;) In short: it's very unlikely you'll be able to do this. :) p.s. when granting a user permissions to connect from outside (yourself in this case) and you have a fixed ip-address, it's best to use that instead of % |
|
Written by jossiejojo
6 years ago 4 posts since Fri, 11 May 07 |
This is what the lycos admin pages look like To access your database, you can use our MySQL Manager. From your PHP scripts, you have to use the following parameters: Database Type: mysql Database HostName: localhost (you can not connect to your database from outside of your website) Presumably HeidiSQL cant be used with Lycos servers??? |
|
Written by ansgar
6 years ago 3958 posts since Fri, 07 Apr 06 |
jossiejojo wrote: ... you can not connect to your database from outside of your website) [/i] Exact. The server has to allow external connections as HeidiSQL is normally not installed on the server itself. |
|
Written by jossiejojo
6 years ago 4 posts since Fri, 11 May 07 |
Thats a shame it looks like a really nice bit of kit. Congratulations on it by the way and thanks for your help and your time. |
|
Written by jossiejojo
6 years ago 4 posts since Fri, 11 May 07 |
Whats annoying is that I cant get phpmyadmin to work on the lycos servers and cant find any other software that I can use to import an old database. Have you any suggestions? Failing that can you recommend an ISP that would let me use HeidiSQL to set up a fairly big Simple Machines Forum?? |
|
Written by siMKin
6 years ago 104 posts since Sun, 01 Apr 07 |
wrote: Whats annoying is that I cant get phpmyadmin to work on the lycos servers and cant find any other software that I can use to import an old database. Have you any suggestions? PHPMyAdmin is just a PHP script. So if you follow the instructions in the readme, it should just work. I don't have that much experience with the program myself, but i can't think of any reason why it wouldn't. Anyways, the best place to ask help would be at the PHPMyAdmin Help Forum |
|
Written by tomovo
6 years ago 1 posts since Tue, 02 Oct 07 |
Hello, congratulations for a great piece of software. Using HeidiSQL on my machine works great, but connecting to a remote site fails. I am not sure if this is a bug or not. My ISP told me it should be possible to connect to their mysql machines from outside. However I get an "Access denied error". What's interesting is that the error message says something like "SQL Error: Access denied for user: db.mydomain.c@sql.myisp.com (Using password:YES)" BUT the username I filled in in the connection dialog in HeidiSQL is db.mydomain.com. So I'm wondering - is the username being cut off after a certain number of characters in HeidiSQL [1], is it done by MySql [2] or is it just shortened for the error message [3]. If it's [1] I think that would count as a bug :-) Best regards Tom |
|
Written by siMKin
6 years ago 104 posts since Sun, 01 Apr 07 |
Access for a user is always tied to a domain. When your grant access to a user you define this as follows: GRANT ALL ON database.* TO user@domain IDENTIFIED BY 'password' That's why the error message is formatted as user@domain - this is just the format that mysql uses. But, in reality everything before the @ is the username and everything after it the domain. See also this sticky: http://www.heidisql.com/forum/viewtopic.php?t=247 wrote: My ISP told me it should be possible to connect to their mysql machines from outside. That's a pretty vague answer coming from people that should be able to tell you yes or no ... :? |
|
Written by ansgar
6 years ago 3958 posts since Fri, 07 Apr 06 |
tomovo wrote: What's interesting is that the error message says something like "SQL Error: Access denied for user: db.mydomain.c@sql.myisp.com (Using password:YES)" BUT the username I filled in in the connection dialog in HeidiSQL is db.mydomain.com. I just tested that by creating a user "db.mydomain.com" on my local mysql server which let's me connect via HeidiSQL - no problem. Then I deleted the user from the priv tables again and - what a surprise - could no longer connect via HeidiSQL. The username in the error message is not cut. However, if I try to create a user with a longer username than 16 characters, the server replies with an errormessage wrote: String 'db.mydomain.comdb.mydomain.com' is too long for user name (should be no longer than 16) So I created a username with exactly 16 characters: "1234567890123456". I can connect with HeidiSQL and this username. My guess is - as siMKin already said - that your provider has set the "skip-networking" option in the my.cnf or my.ini on his server. |
|
Written by jan
6 years ago 14 posts since Wed, 15 Aug 07 |
to follow up the topic, i do not recommend, to allowed any user from other than localhost. Better, i recommend you, to add the port 3306 to your firewall and deny connections. wrote: All other information [than the password] is transferred as text, and can be read by anyone who is able to watch the connection. but the proper solution is, to ask putty for help. wrote: PuTTY is a free implementation of Telnet and SSH for Win32 and Unix platforms, along with an xterm terminal emulator. |
|
Written by Remigius
6 years ago 3 posts since Thu, 06 Sep 07 |
Great stuff Jan, I've been using Putty for ages for simple shell access but I didn't know about the SSH tunneling. Thanks for the writeup! |
|
Written by ztdaneo
5 years ago 2 posts since Wed, 02 Jul 08 |
when ever im done typing in all the info needed i press open like im supposed to then it comes with a error msg sayin Network error: Connection timed out can u pls help BTW this is on puTTY |
|
Written by Borstensohn
5 years ago 2 posts since Mon, 14 Jul 08 |
Some MySQL frontends (MySQL Front, SQLyog) can connect to an external MySQL database via HTTP tunneling. You have to copy a certain PHP file onto your server, using an FTP client. Then the MySQL client can connect over this PHP file, because it is on the same domain like the MySQL database ("localhost"). I'd like HeidiSQL to have this functionality too, maybe in the near future. |
|
Written by ansgar
5 years ago 3958 posts since Fri, 07 Apr 06 |
http://code.google.com/p/heidisql/issues/detail?id=368 http://www.heidisql.com/forum/viewtopic.php?p=2020 |
|
Written by Borstensohn
5 years ago 2 posts since Mon, 14 Jul 08 |
Illegal, you say? But then I wonder why some commercial front-end programs feature HTTP-tunneling. In my opinion, it's easier and quicker than using phpMyAdmin on the web server. Anyway, I respect your opinion. |
|
Written by ansgar
5 years ago 3958 posts since Fri, 07 Apr 06 |
Well, to be honest there is a second reason why there is no HTTP tunnel in Heidi: It's a lot of effort and noone on the developers list who likes to implement it :) |
|
Written by shilpashree
1 year ago 1 posts since Sat, 10 Mar 12 |
Hi, I have my project hosted on a virtual dedicated server. (Linux). Followed the instructions mentioned above but no luck :( I get SQL error (2013) Lost connection to MYSQL server at "reading initial communication packet" |
|
Please login to leave a reply, or register at first. |


