How to use HeidiSQL (or similar MySQL managers) with hosted databases - mysql

I'm using HeidiSQL ( http://www.heidisql.com/ ) to manage my databases at work (I prefer this over phpMyAdmin).
Now, I want to use HeidiSQL with my personnal host plan, but when I connect to MySQL with my host, I connect with "localhost" in PHP but at work, I connect to databases with something like "supersqlserver.foo.net"...
Is there a way to connect to my hosted database with HeidiSQL? Is it common practice with hosts to allow the use of software like this?
BTW, the host where I want HeidiSQL to work is HostGator.

When you can't connect to the MySQL server directly, for example a firewall blocks the access from all network protocols, except HTTP protocol, you can use HTTP tunneling.
Here an example of connecting to MySQl through Httptunnel using HeidiSQL.

Ask your HostGator support. They should be able to help you. Maybe they only listen on localhost, and then you can't connect from the outside. It's rather common to not listen for external MySQL connections due to security policies, but some hosts allow it.

Related

MySQL - change connection to MysqlWorkBeanch

I have a server at Amazon with my Database and I usually acess by hpMyadmin with no problem, but I hate that. I downloaded the MYSQL WorkBench but I can't connet to my server, anyway. I am always receiving the same message as follow:
Connecting to MySQL server ... Can't connect to MySQL server on (10061)
Someone, did have the same problem or known how to do?
Thank you.
Most providers allow access to database only from they local network. Databases aren't visible from the internet. The reason - security.
Server with phpMyAdmin is located in their internal network so it have no problem with accessing to database, but your computer is on the outside and DB isn't visible for it, hence the connection error.
If you have ssh(or vpn) access to machine (but you probably don't) you can create tunnel and access your DB through it with workbench.
On the other hand, you should be able to upload your own web client, different than phpMyAdmin e.g http://mywebsql.net/

How to config Yii framework to connect MySQL over SSH?

I have local MySql server and want Yii to connect to it over SSH. I have try to config config/main.php but failed. How can I do that?
You need to forward port 3306 from the remote server to your local machine and then set Yii to connect to the forwarded port on localhost.
As stated by hd1: This is something you need to do outside of PHP.
The best way is to create an SSH tunnel so that you have a port on the local server to talk to, that connects to your actual database server. There was a discussion on the Yii forum about exactly this, you can find it here
You might want to take a look at AutoSSH as well.

Connecting to a database without remote connection

Due to security considerations from my provider, I am not able to MySQL Workbench to connect to my database. The only way to access my database is to use phpmyadmin. Because I'm used to use MySQL Workbench and their tools, it is for me much easier to maintain my database. Using phpmyadmin is annoying, so I'm googeling a solution to use anyway MySQL Workbench. Is there a way to break this security consideration or to connect MySQL Workbench through phpmyadmin to gain access to the database?
If your hosting provided did it recently then I am pretty sure it is must be a response to this terrible security flaw discovered in mysql last month. The attack is as simple as running that one line shell command.
Not all OS/MySQL combinations are vulnerable. In case your hosting company was, then for a few moments - all customers
logins were at stake (including the root login).
To answer your question, unfortunately you can not do much in this case. You cannot do any port forwarding tricks even if you have shell(ssh) access because normally port forwarding isn't allowed in shared hosting environments.
In case you want to try, you can run this command on a unix box
$ ssh -L 3306:localhost:3306 username#yoursite.com
If you can login and don't see any errors related to port forwarding, perhaps your can direct your workbench to localhost on port 3306 and theoretically it should work.
If you are using windows you can use putty to do port forwarding as described here.
I think no. Only changing table Users in MySQL you can access from other IPs and hosts. And this table is not accessible by other users.

Connecting to MySQL Database over server

I'm quite a beginner when it comes to working with networks and the like, so apologizes up front. A while back I set up a mySQL database locally on my machine, and have built a number of simple programs that work with it. (aka root:localhost sort of thing).
This has been great, but I'm now hoping to allow other colleagues at my work to access the database from their machines, but I have no idea how.
Likely there will be some network protection issues (firewalls etc), so that may need to be taken into account... (although I have IT's help on this, neither IT or myself really know what is required to 'connect' to the database).
For example, is it just an IP I need? Do I have to change the setup of my database? I understand that localhost would not work from my colleagues computer's, for obvious reasons, I have no idea what would go in its place for others to access it.
I also do not mind having my machine run as the dedicated database machine... I would not be able to run it off a dedicated server or anything like that, beyond my machine.
Any help would be much appreciated!
Thanks.
First of all, what your colleagues need are:
The IP Address where MySQL server is
running.
User and Password to connect remotely
Have the port 3306 open on the network
A MySQL Client (mysql workbench, mysql query browser, toad, heidi or just the Command Line tool).
When you create user in MySQL the have to be something like this:
'root'#'localhost'
That means, the user will work if you connect from localhost with the user root. So you can create user allowed to connect from anywhere:
'juanperez'#'%'
And finally you have be careful about what privileges are you granting to them. Do not forget to comment a line in the options file of the MySQL that says "bind-address" (this options prevents remote connection).
For example, is it just an IP I need?
Yes. You'll be much happier if you set up proper domain names, but a domain name is just an alias for the IP address.
Do I have to change the setup of my database?
No, but... You have to add some user credentials to support remote logins. That's a change, but not a change to a schema. It's changes to the permissions.
I understand that localhost would not work from my colleagues computer's, for obvious reasons, I have no idea what would go in its place for others to access it.
What MySQL Admin tools are you using? Often there is good help there.
You must read reference manual 4.1 or 5.0
For whatever version is appropriate.
It's very clear.
A user is identified by a username#hostname. You can specify IP addresses (or even "%" for the hostname.
You will use following commandline to connect -
mysql -u<user-id> -p<password> -h<your-hostname-or-ipaddress>
For applications running on different machines trying to connect to your database, you only need to replace 'localhost' with your machine's hostname or ipaddress.
In, general if you are able to ping your machine from a different system, your database can be connected to from that machine, just use whatever name you used for 'pinging' in place of localhost.
Use your workstation IP address or workstation name. You will need to enable remote access. Go to this link for how:
http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html

Securely connect MS Access database front-end to MySQL back-end on web host?

We have a fairly simple M$ Access db, split into front-end (forms, reports, etc.) and back-end (tables). Currently looking for a way to get the tables with all the critical data off of one desktop and hopefully into a MySQL database on our web host, and be able to connect to it from multiple PCs (still probably only one or two people connecting to it at any give time), and eventually, hopefully, migrate to a web application when time allows. Many of the examples I've read about people connecting an Access db front-end to a MySQL back-end seem to imply that they are doing so on a LAN, probably behind a firewall, etc.
Is it at all safe to connect a M$ Access front-end to a MySQL backend when that mysql server is running on a remote web host? Does the ODBC connector take care of encryption?
TIA,
Monte
You could use putty to mount a ssh tunnel to your mysql server and redirect the remote mysql port to your machine.
Using putty is pretty straightforward:
Give it your mysql server dns name as the host and go to "Connection/SSH/Tunnels", there you define the local port to connect in the "Source Port" field (e.g. 3307).
In the the "Destination" field put the dns name of your mysql server followed by a colon and the port mysqld is running in (e.g. mysql.example.org:3306).
Save this as a profile then connect and the remote mysql port will be availbable locally on port 3307.
Just make sure you restrict the user because by default he will have an ssh shell on the server.
Setting up key authentication would also be practical because you won't have to enter a password to connect to the server (but be sure to protect your key on disk by encrypting it).
EDIT: It seems the mysql odbc connector support ssl, you could use that too but I'd personnally choose to use SSH anyway as you will have it already on your mysql server.