آموزش تنظیم mysql remote در دایرکت ادمین
1.SSH to your web server as root.
2.Edit /usr/local/directadmin/conf/mysql.conf to add in the IP of the remote mysql server as host:
user=da_admin
host=123.123.123.123
passwd=H&*(h@123
|
3. SSH to your remote mysql server, make sure mysql service is installed, you can test it by:
If nothing is showing, you will need to install mysql.
mkdir mysql
cd mysql
wget http://files.directadmin.com/services/all/mysql/64-bit/5.5.11/MySQL-shared-5.5.11-1.linux2.6.x86_64.rpm
wget http://files.directadmin.com/services/all/mysql/64-bit/5.5.11/MySQL-devel-5.5.11-1.linux2.6.x86_64.rpm
wget http://files.directadmin.com/services/all/mysql/64-bit/5.5.11/MySQL-client-5.5.11-1.linux2.6.x86_64.rpm
wget http://files.directadmin.com/services/all/mysql/64-bit/5.5.11/MySQL-server-5.5.11-1.linux2.6.x86_64.rpm
rpm -Uvh MySQL-*
|
4. Login to mysql service in remote mysql server.
5. Grant full privileged to da_admin.
GRANT ALL PRIVILEGES ON *.* TO da_admin@132.132.132.132 IDENTIFIED BY 'H&*(h@123' WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit
|
Take note that 132.132.132.132 is the IP of you webserver, you are granting permission to let the webserver to access to your remote mysql server.
6. Test below command in the webserver to check if webserver can access to remote mysql server now.
mysql -uda_admin -p --host=123.123.123.123
|
7. Final test, Test it out in DirectAdmin to make sure webserver can create and manage databases via Mysql Management.
8. To allow usage of phpmyadmin so that you can manage mysql databases, please edit:
/var/www/html/phpMyAdmin/config.inc.php
|
Find this line:
$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address
|
And change it to:
$cfg['Servers'][$i]['host'] = '123.123.123.123'; // MySQL hostname or IP address
|