Issue
am trying to install phpmyadmin on my vps along Maraiadb which i installed from source. Mariadb 10.1.12 is ok running . when i try to install phpmyadmin
apt-get install phpmyadmin
then it display
The following extra packages will be installed:
libdbd-mysql-perl libmysqlclient18 mysql-client mysql-client-5.5 mysql-common php5-mysql
Suggested packages:
mysql-server maridadb-server virtual-mysql-server www-browser
The following NEW packages will be installed:
libdbd-mysql-perl libmysqlclient18 mysql-client mysql-client-5.5 mysql-common php5-mysql phpmyadmin
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
if i go with it by press y , then after that my Mariadb not works it give socket problem ,
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
maybe due mysql-client installed with phpmyadmin , then to fix it i purge mysql packages ,
sudo apt-get --purge remove "mysql*"
then mariadb start working normally again.
so i want to know is there anyway i can install phpmyadmin without these dependencies , i tried to find phpmyadmin in
/var/lib/dpkg/status
so that i could remove its dependencies but phpmyadmin was not in list :(
am using debian 8 jessie
Solution
phpmyadmin
seems to have an sql server as a dependency and thus it installs mysql by default. As you already have a self-compiled version of Mariadb installed this causes issues. In your case mysql seems to use the socket you actually want to use for Mariadb.
You could of course change the ports/sockets of these two sql servers so they can run simultaneously, but it does not make much sense to run two sql servers at the same time on the same server.
The better way...
So the better way is to create a fake package of the mysql server you have installed. You can do this with equivs
. More information: How to tell apt that dependencies are resolved manually?.
So in your case you should get out which maraiadb
packages are installed by Debian and fake every single package where you know you have already installed the content on your server.
Here is my general guide for
How to use equivs
I advise you to use a new folder when tinkling with fake packages. (mkdir ~/fakepackages && cd ~/fakepackages
)
- Get the original package of the program you want to fake:
apt-get download mypackage
Get the control file of the
.deb
file. You can do this by extracting the .deb file and find the control file.I recommend the following steps:
- Create a new directory and move into it:
mkdir package&&cd package
(you may do this already before downloading the .deb file) ar xv package.deb
tar xzf control.tar.gz
- Copy the control file to a place where you find it:
cp control ../mypackage.ctl.orig
- Get out of the directory and delete it:
cd ..
andrm -rf package
- Create a new directory and move into it:
- Leave the control file open.
- Create a new control file:
equivs-control mypackage.ctl
It will give you a template. Now combine the information you know about the (self-compiled) program you have installed and want to fake and the information of the original control file to create your fake control file. You should try to add as much true values as possible. It is important that at least these values are provided:
- Section
- Package
- Provides (if the original control file has it)
- Description
In the description you should make clear that the package is a faked one.
- Build the fake package:
equivs-build mypackage.ctl
- Install the fake package:
sudo dpkg -i mypackage_1.0.deb
Answered By - rugk Answer Checked By - David Goodson (WPSolving Volunteer)