Knowledge Base

How Can We Help?

Set up DirectAdmin to Use a Remote MySQL Server

You are here:

We are able to arrange MySQL to be run on an exterior server when we’ve got a big database that will require administration and monitoring of its personal. One of the simplest ways to take action is to host MySQL on a distinct server. Then we will join our software to our Distant MySQL database which is fairly easy.

This shouldn’t be wanted too typically, as regular, you may simply transfer all these consumer accounts to a different server to consolation and preserve the load. However within the case of a giant database utilizing up the entire server, you don’t have many selections.

Arrange DA to Use a Distant MySQL Server

1) Firstly, set up MySQL on the distant server. DirectAdmin is just not required on this server, because it simply used to host our MySQL Databases and nothing else.

2) The following transfer is to create/setup up a consumer {that a} DirectAdmin can hook up with on the distant MySQL server. Usually the default consumer for DirectAdmin is da_admin, so the reference to the identical title is healthier however not required.

The username and password you’ve got created for the brand new consumer should be set within the /usr/native/directadmin/conf/mysql.conf file for DirectAdmin to make use of. On a facet observe, if the distant server is on a LAN IP, and the connecting IP to that distant server is not going to be the identical as your server IP, however reasonably another IPs. As a substitute of server IP, you may add an entry host by default within the /usr/native/directadmin/conf/mysql.conf file.

Add the next line to the file talked about within the earlier paragraph:

access_host=x.x.x.x

The place x.x.x.x is the IP or host would be the IP handle of your distant database server.

Please observe that the above given methodology is just for grants da_admin on the “localhost”, which means it’s a must to already be on that distant MySQL server to make use of the account. You’ll need so as to add one other entry host or IP to permit the DA server to hook up with it. Usually, you simply run the GRANT ALL PRIVILEGES ON *.* TO [email protected] command once more, however change localhost to the IP of your DA server. Identical to this.

GRANT ALL PRIVILEGES ON *.* TO [email protected] WITH GRANT OPTION;
FLUSH PRIVILEGES;

We don’t want the “recognized by go” once more on this case, as a result of the password is already from including it the primary time.

3) On this occasion, the distant MySQL database shall be prepared and located to just accept the DA to make use of it. You’ll be able to take a look at this by logging to your DA through SSH after which kind:

mysql -uda_admin -p --host=x.x.x.x

The place x.x.x.x is the IP of your MySQL server. In case you are not in a position to join, then you have to have to test your settings once more, additionally be sure that the MySQL port 3306 is open on the distant field.

4) Then inform DirectAdmin to make use of the distant server.

Edit the configuration file: /usr/native/directadmin/conf/mysql.conf

add the road: host=x.x.x.x

the place x.x.x.x is the IP of your distant server. Be certain that there’s a newline character on the finish of the road. (Eg, press enter)

5) Enter into DA and test the MySQL part of your consumer degree to see should you get any sort of errors associated to this. If not, then you may attempt for including a database to ensure it really works.

6) The one authorize job would then be to repair up phpMyAdmin additionally hook up with the distant host. To take action, Edit /var/www/html/phpMyAdmin/config.inc.php.

Then discover the next line within the configuration file:

$cfg['Servers'][$i]['host']          = 'localhost'; // MySQL hostname or IP handle

Change it to the next.

$cfg['Servers'][$i]['host']          = 'x.x.x.x'; // MySQL hostname or IP handle

The place x.x.x.x is the IP of your MySQL server.

7) For brand new MySQL consumer databases, you will want to inform the DirectAdmin in regards to the new IP, so that they have that IP assigned into their entry hosts.

Should you want any additional assist, please do attain our help division. Or remark down your question within the remark part given under.

Leave a Comment