Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 6838  / 1 Year ago, sat, april 29, 2023, 6:04:04

I've got what's probably a very easy question to solve, but I've been stuck on it for a few days now.



I've got 3 servers running in a small network, DNS, HTTP and MySQL. I've got apache2 and PHP5 installed on the HTTP server and MySQL on the MySQL server. I'm trying to install phpmyadmin on the apache2 server but when I try, I get error 2002 (hy000) because /var/lib/mysql/mysql.sock cannot be found, obviously because it isn't installed on that server.



I understand phpmyadmin requires both apache2 and MySQL to run, however, is there a way I can install it on either server while still keeping the servers separated? Ideally on the apache2.


More From » server

 Answers
5

I did manage to fix it. From a basic install of phpmyadmin these are the steps to allow remote connection. If anyone ever needs it




  1. Code out



    /etc/phpmyadmin/confi.inc.php
    $cfg['Servers'][$i]['controluser'] = $dbuser;
    $cfg['Servers'][$i]['controlpass'] = $dbpass;

  2. Edit /etc/phpmyadmin/apache.conf



    10.0.0.157 is the machine you want to access the myphpadmin website from



    Order Deny, Allow
    Deny from all
    Allow from 127.0.0.1
    Allow from 10.0.0.157

  3. Edit and change /etc/my.cnf



    This allows any machine on the network to connect to the mysql



    bind-address = 0.0.0.0

  4. edit /etc/phpmyadmin/config.inc.php put add at the bottom



    $i++;
    $cfg['Servers'][$i]['host'] = '10.0.0.40'; //mysql server IP
    $cfg['Servers'][$i]['user'] = 'username'; (username you want to log into 10.0.0.10/phpmyadmin) (10.0.0.10 is the server that has phpmyadmin on)
    $cfg['Servers'][$i]['password'] = 'password'; //password
    $cfg['Servers'][$i]['auth_type'] = 'config'; // keep it as config`



This allows me to log in on my windows machine with the IP 10.0.0.157 in a web browser with 10.0.0.10/phpmyadmin with the username/password combo as above.



When 10.0.0.10/phpmyadmin is accessed, this drop down menu is the addition are given with #4



I can't post the image as I don't have 10 rep points :-( but it will give you a drop down menu of users with the IP address/username set up in #4


[#20587] Sunday, April 30, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sconhoney

Total Points: 403
Total Questions: 118
Total Answers: 109

Location: Andorra
Member since Mon, Jan 9, 2023
1 Year ago
;