Control Web Panel
WebPanel => MySQL => Topic started by: pere on April 18, 2022, 06:33:40 PM
-
In my server, I have one site A with a database. Now I have a 2nd site B that needs to connect to database in A. From B I've tried to get the connection parameters with
include("./home/A/public_html/settings/settings.inc");
but no success. In settings I have ########## Database Info ##########
define('DB_SERVER', 'localhost');
define('DB_USER', 'myUser');
define('DB_PASS', 'myPass');
define('DB_NAME', 'ThedbName');
define('DB_CHARSET', 'UTF8');
I'll appreciate your help.
-
You cannot access /home/A from /home/B by default for security purposes. You have a few options.
1) Copy the settings.inc from /home/A to /home/B and chown the files to B
2) You can use "setfacl" to give B permission to A's files
3) You can make B part of A's group in linux "usermod -G A"
-
Thank you!