DWQA QuestionsCategory: MysqlHow to manage remote MYSQL DATABASES from local machine on UBUNTU ?
kundan roy asked 4 years ago

Step1 :

To use phpMyAdmin to administer a MySQL database hosted on another server, adjust the following in

/etc/phpmyadmin/config.inc.php: sudo nano /etc/phpmyadmin/config.inc.php

Step2:

Then change the line that looks like the one below

$cfg[‘Servers’][$i][‘host’] = ‘$dbserver’; to $cfg[‘Servers’][$i][‘host’] = ‘158.168.69.21’;

Note: Replace $dbserver with the actual remote database server name or IP address

Step3:

sudo ln -s /etc/phpmyadmin/apache.conf  /etc/apache2/conf-available/phpmyadmin.conf

Step4:

sudo a2enconf phpmyadmin.conf

Step5:

sudo systemctl reload apache2.service

Step6:

sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf

Then change the line below to:

bind-address = 0.0.0.0

Step7:

sudo mysql -u root -p GRANT ALL PRIVILEGES ON *.* TO ‘root’@’your_local_machine_ip’ IDENTIFIED BY ‘root_password_here’ WITH GRANT OPTION;