MySQL Fails to Reinstall (Ubuntu 12.10 Server) - mysql

I'm running a Wordpress installation on an Ubuntu 12.10 server. The site was running fantastically until we had sporadic MySQL issues, where the site would "whitescreen" for a few hours, then return to normal.
Someone who should not have been toying around with the server removed MySQL to attempt a reinstall, and now mySQL refuses to reinstall. I get the following errors when running sudo apt-get install -f mysql-server from root.
Setting up mysql-server-5.5 (5.5.35-0ubuntu0.12.10.2) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.5
mysql-server
In addition, I couldn't connect to MySQL through the socket before this all happened.
Things I've tried, as recommended here/on other websites:
Restarting mysqld Deleting and (attempting) reinstallation of mysql-server
deleting all files shown when running dpkg -S etc/mysql
apt-get purge mysql-server mysql-client mysql-common mysql-client-5.5 mysql-server-5.5
apt-get auto cleans
apt-get with the -f flag
Numerous server reboots and restarts
Tears

Have you tried entering this through terminal/PuTTy?
apt-get install mysql-server mysql-client

Related

Unable to uninstall mysql

Hi I've been having some problems lately with starting mysql in Ubuntu-22.04.
When i try sudo service mysql start an error pops up:
Failed to start mysql.service: Unit mysql.service failed to load properly, please adjust/correct and reload service manager: File exists
See system logs and 'systemctl status mysql.service' for details.
I've also tried some "fixes" from stackoverflow and other forums but none of them seemed to work mainly because of the autoremove part.
root#server-HP-Z420-Workstation:~# apt autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-8.0 (8.0.30-0ubuntu0.22.04.1) ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn't exist
dpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess returned
error exit status 2
Errors were encountered while processing:
mysql-server-8.0
E: Sub-process /usr/bin/dpkg returned an error code (1)
Any ideas?
Try uninstalling and installing the server like this:
sudo apt-get clean
sudo apt-get purge mysql*
sudo apt-get update
sudo apt-get install -f
sudo apt-get install mysql-server-8.0

Problems installing MySQL on Ubuntu 20.04

I am trying to install MySQL 8.0 in Ubuntu 20.04 with sudo apt install mysql-server, but this error keeps showing up after reinstalling and after using sudo dpkg --configure -a :
Setting up mysql-server-8.0 (8.0.25-0ubuntu0.20.04.1) ...
/var/lib/dpkg/info/mysql-server-8.0.postinst: line 191: /usr/share/mysql-common/
configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess returned
error exit status 127
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-8.0; however:
Package mysql-server-8.0 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
I completely uninstalled MySQL and reinstalled it multiple times with sudo apt remove --purge --autoremove mysql-server, but the error persists.
I got the same problem and just found nice article
to solve it.
Indeed deleting files directly from your MySQL folder is really not recommended. You can take a look at this guide here on how to delete old MySQL binary files here.
Regarding your current issue. In order to completely get rid of your MySQL installation you could run the following:
Make sure MySQL is not running:
sudo systemctl stop mysql
Then purge all the MySQL packages:
sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*
Then delete all the MySQL files:
sudo rm -rf /etc/mysql /var/lib/mysql /var/log/mysql
Finally clean all packages that are not needed:
sudo apt autoremove
sudo apt autoclean
Hope that this helps!
Stop the Mysql if it is running
sudo systemctl stop mysql.service
sudo kill $(pgrep mysql)
Then purge everything , this will also remove Mysql-workbench
sudo apt-get remove --purge mysql-\*
Then reinstall mysql-server and mysql-client
sudo apt-get install mysql-server mysql-client

unable to uninstall mysql broken mysql / install new mysql

I have made some shitty things to MySQL and I facing this.
I am trying to re-install MySQL. directly deleted the MySQL folder using sudo rights and tried to re-install.
the fix will be greatly appreciated
command I am running
sudo apt-get install mysql-server
following is the output I am receiving
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (5.7.26-0ubuntu0.18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-5.7 (5.7.26-0ubuntu0.18.04.1) ...
/var/lib/dpkg/info/mysql-server-5.7.postinst: line 191: /usr/share/mysql-common/configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-5.7 (--configure):
installed mysql-server-5.7 package post-installation script subprocess returned error exit status 127
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
https://askubuntu.com/a/1134184/653440
do: sudo apt edit-sources and look for anything containing mariadb like: deb [arch=amd64,arm64,ppc64el] http://ftp.nluug.nl/db/mariadb/repo/10.3/ubuntu bionic main
comment it out by putting a # in front of it. then run
sudo apt update
sudo apt purge mysql-common
sudo apt install mysql-common
after that you can installed mysql-server properly via sudo apt install mysql-server
Helped me fix the issue.

Can not install mysql ubuntu after removing maria db

I was working on mysql database, and unfortunately I installed mariadb and when I want to go back to mysql I have error , I removed mariadb and trying to install mysql with this command
sudo apt-get install mysql-server
but I have this error
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (5.7.22-0ubuntu0.16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-5.7 (5.7.22-0ubuntu0.16.04.1) ...
update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn't
exist
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a
followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
and I can not re install mysql , what can I do , I looked for solution but don't have result
Try doing a purge, then re-install.
sudo apt-get remove --purge mysql-\*
sudo apt-get install mysql-server mysql-client

Installation Error Mysql to Debian on BeagleBone

When logging in through mysql -u root -i, I get the following error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I've tried sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5, I've auto removed, cleaned, removed all associated files. After all that, I did a sudo apt-get remove --purge mysql* just to be safe. Then I installed it again: sudo apt-get install mysql-server
I get an error during the installation:
Setting up libmysqlclient18:armhf (5.5.43-0+deb7u1) ...
Setting up libdbd-mysql-perl (4.021-1+b1) ...
Setting up mysql-client-5.5 (5.5.43-0+deb7u1) ...
Setting up mysql-server-core-5.5 (5.5.43-0+deb7u1) ...
Setting up mysql-server-5.5 (5.5.43-0+deb7u1) ...
[ ok ] Stopping mysql (via systemctl): mysql.service.
[....] Starting mysql (via systemctl): mysql.serviceJob failed. See system journal and 'systemctl status' for details.
failed!
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
I'm not really sure what else I can do.
So I guess the purge and installation worked. On one last whim, I decided to reboot my BeagleBone and try again. It worked.