1

I have 2 server A (Code) and B (Database). I need to access (connect) A to B. I am using mysql 5.6 phpmyadmin and php running in ubuntu 14.04. All I know is that i need to whitelist a user in phpmyadmin. Since I am new to this, can anyone guide me on this.. I have made changes in database.php in server A as follow

$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'IP of Server B';


$db['default']['username'] = 'abc';
$db['default']['password'] = '123';
$db['default']['database'] = 'db1';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE; 

After doing this change when i run the my server A the following error pops up

Unable to connect to your database server using the provided settings.

Filename: core/Loader.php

Line Number: 338

I have even edited /etc/mysql/my.cnf in server B by binding the server's IP.

bind_ip=[Server B IP]
Community
  • 1
  • 1

2 Answers2

1

I can not comment so I'll just add it here, first of all, make sure you can access your database server remotely. Under normal circumstances port 3306 will be blocked.

Odyssey1111
  • 134
  • 8
  • I have even prescribed the same port in database.php. Still no luck. – darshan krishnaiah Oct 10 '17 at 08:34
  • if using the standard port, no need to define it again in database.php, did you restart the server after editing the `my.cnf`? Maybe this will help: https://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html – Odyssey1111 Oct 10 '17 at 09:11
0

Once all the proper credentials are given in database.php, we need to comment out bind-address=1270.0.1 in /etc/mysql/my.cnf file of Server B. Before that stop mysql and restart it once the editing is done.