Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remotely connect to ClearDB in an Azure Website?

I have created a free Azure Website with Wordpress on it. A ClearDB mysql database was automatically created.
I want to remote connect to the DB using something like MySQL Workbench.
I used the credentials from the "View connection strings" in the azure portal dashboard, but there is an error connecting.

I read in some post that the db itself is hosted in azure cloud and thus can not be accessed. Have anyone managed to administrate a DB like this ?

like image 975
Yaron Levi Avatar asked Dec 04 '13 19:12

Yaron Levi


2 Answers

Mostly hoster don't allow an external connection with shared hostings.

When you use an outside client, your server has to be configured to allow this external connection.

Firewall rules :

You must to set password before make this, for security improvement.

You must to update firewall and make rules to open the mysql port (3306) on the server that is running the mysql database.

Set user IP :

Add an user account or replace ip address.

Adding users :

CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'

Replace ip address (be careful don't use this on the root user) :

RENAME USER 'user'@'ipaddress2' TO 'user'@'ipaddress2';

To allow all ip replace ip adress by %.

See more :

  • Security Guidelines.
  • How to determine if a port is open on a Windows server? or www.portcheckers.com.
like image 188
Sky Voyager Avatar answered Oct 08 '22 04:10

Sky Voyager


Yes, it is possible to administer your ClearDB MySQL database in MySQL Workbench. I have several Azure Wordpress sites that I connect to just as you describe -- create the Azure site, view Connection Strings, type those credentials into MySQL Workbench, and voila. @Yaron, Can you be more specific about what you've tried and maybe we can troubleshoot from there?

like image 36
Southerneer Avatar answered Oct 08 '22 05:10

Southerneer