It was working fine before and I was configuring the email server when I restarted the mysql (via /etc/init.d/mysql restart). I'm pretty sure that I did not touch anything in there but I can remember doing a failed apt-get update prior to that.
Now my problem starts when all of a sudden it stops and won't even start. I searched on google and even went far to purging everything and doing a new install. But still it won't let me install mysql properly.
I've tried (after doing a remove --purge):
sudo apt-get install mysql-server-5.5 mysql-client-5.5
and it prompts me for a root passsword, but returns me the following error:
Unable to set password for the MySQL "root" user
An error occurred while setting the password for the MySQL administrative user. This may have
happened because the account already has a password, or because of a communication problem with the
MySQL server.
You should check the account's password after the package installation.
Please read the /usr/share/doc/mysql-server-5.5/README.Debian file for more information.
and I have the following logs too:
Selecting previously deselected package mysql-server-5.5.
(Reading database ... 117879 files and directories currently installed.)
Unpacking mysql-server-5.5 (from .../mysql-server-5.5_5.5.32-0ubuntu0.12.04.1_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up mysql-server-5.5 (5.5.32-0ubuntu0.12.04.1) ...
130830 14:13:26 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys'
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
Errors were encountered while processing:
mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)
any help? Thanks in advance.
this question was having the same issue it solved by uninstalling but before that he tried to set the password that is the question and then he tried to solve it in chat maybe when you try to set a password it will be solved , just try
Update: Type the following commands in your terminal in order to make a complete remove for mysql.
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
Also you need to remove the /var/lib/mysql folder if exist by typing the following command
sudo rm -rf /var/lib/mysql
Then follow the official ubuntu documentation to install. and don't forget to set your mysql password during installation.
Also see this question its similar to the error you have got during the installation process.
I experienced this problem.
maybe aptitude have some config for package.
I think this problem of interference
Although, this method is purge command .
try running.
check installed mysql package
dpkg --get-selections|grep mysql
remove
apt-get remove --purge [installed package]
apt-get autoremove
apt-get autoclean
aptitude purge [installed package]
aptitude clean
aptitude update
aptitude -f install
aptitude full-upgrade
install
apt-get install mysql-server
Related
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
I am a beginner Linux user. Yesterday, I tried to install MySQL on my Linux mint laptop. I have installed Apache successfully, but I have got the following errors while trying to install MySQL.
Setting up mysql-server-5.7 (5.7.25-0ubuntu0.18.04.2) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
dpkg: error processing package mysql-server-5.7 (--configure):
installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
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.
Processing triggers for systemd (237-3ubuntu10.17) ...
Processing triggers for ureadahead (0.100.0-20) ...
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get dist-upgrade
I have tried to find a way again from the web but nothing works and I can't sleep because of this..:(
I installed MySQL on Mint numerous times, but I recently started to have the same problem - all out of the blue.
Try the steps here:
https://vitux.com/how-to-install-and-configure-mysql-in-ubuntu-18-04-lts/
sudo apt-get update
sudo apt-get install mysql-server
sudo mysql_secure_installation
You will have a few yes and no options for your MySQL server. Choose as appropriate for you, then log in using sudo mysql, not just mysql
sudo mysql -uroot -p
The prompt will change from whatever your linux login user is to mysql>
For a list of the users automatically created:
mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;
Change the authentication method for root user, and assign a new password if you want:
mysql> ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Now you will be able to access MySQL server from MySQL workbench. In all honesty, I suggest to use that because it makes your life much easier.
I decided to sign up to askubuntu.com, because i really need an advice from experts: I made, with mkusb, a persistent USB Live installation of Ubuntu 16.10, since I'd like to have a portable development environment. Everything went good, and I'm writing from that Live right now.
Now the question: I managed to install apache2, but after hours and hours of searching in the web, and also on this site, I cannot still properly install MySQL server. After re-executing many time the installation, I continue to get this error:
Setting up mysql-server-5.7 (5.7.17-0ubuntu0.16.10.1) ...
ERROR: Unable to start MySQL server:
mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
Please take a look at https://wiki.debian.org/Teams/MySQL/FAQ for tips on fixing common upgrade issues.
Once the problem is resolved, run apt-get --fix-broken install to retry.
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script 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)
And if I run
sudo mysqld --initialize
The terminal still reports
mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
So i thought to search for this "libaio.so.1" as well, and I finished up installing the libraries "libaio1" and "libaio-dev" (which seems to be the same). The result, however didn't change even if those libraries are correctly installed.
Is this caused from the fact that I'm in a LiveUSB? Or is there another procedure to install/make MySQL recognize (since it's already installed, and I verified that the file exists) libaio.so.1?
I really hope you can help me, because i tried everything. I apologize in advance for any possible mistake made in this question. Thank you.
Oh, and there is an unanswered duplicate on the Ubuntu community made by me, so feel free to remove this question if it stays unanswered. Thank you in advance again.
After more many hours of research, i found that the problem wasn't the LiveUSB or the library itself. The problem was AppArmor, who blocked MySQL to use that library. So I disabled it:
sudo /etc/init.d/apparmor stop
sudo /etc/init.d/apparmor teardown
sudo update-rc.d -f apparmor remove
And a not-so-orthodox way, I completely removed AppArmor, to prevent future problems with:
sudo apt-get purge apparmor
Then I uninstalled and reinstalled MySQL Server flawlessy. It works!
If you got here while installing MariaDB, you can install the libaio1 using below command. The above solutions did not work for me
sudo apt-get install libaio1
Reference is here
maybe you should uninstall mysql and install it again using these command
remove mysql -
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
reinstall
sudo apt-get update
sudo apt-get install mysql-server
sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation
MariaDB 10.1.3, kernel 3.19.3, Debian
Problem: apt-get upgrade always fails due to mariadb-server timezone issue.
my.cnf contains
[mysqld]
default_time_zone=America/New_York
I also imported the tzinfo:
# mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
When I manually stop/start the service, there is no issue:
# service mysql restart
[ ok ] Stopping MariaDB database server: mysqld.
[ ok ] Starting MariaDB database server: mysqld ..
[info] Checking for corrupt, not cleanly closed and upgrade needing tables..
However, every single time I run apt-get upgrade, it always fails on mariadb-server:
# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
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]?
Setting up mariadb-server-10.1 (10.1.3+maria-1~wheezy) ...
[ ok ] Stopping MariaDB database server: mysqld.
dpkg: error processing mariadb-server-10.1 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mariadb-server:
mariadb-server depends on mariadb-server-10.1 (= 10.1.3+maria-1~wheezy); however:
Package mariadb-server-10.1 is not configured yet.
dpkg: error processing mariadb-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mariadb-server-10.1
mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
The error is:
# tail /var/log/syslog
mysqld_safe[32269]: [ERROR] Fatal error: Illegal or unknown default time zone 'America/New_York'
This is happening on multiple servers and has become a real annoyance. Could use your help. BTW, it isn't the MariaDB version, as this error has persisted for a couple of years throughout several versions.
EDIT TO ADD: I forgot to mention if I remove the default_time_zone parameter from my.cnf, apt-get upgrade does work. It is only when that parameter is present that apt-get upgrade fails. It needs to be present for my configuration.
EDIT 2: To ensure clarity, even after removing default_time_zone, then doing apt-get upgrade successfully, then adding back default_time_zone and restarting -- future mariadb-* upgrades will fail via apt. There is something specific to the process during apt-get upgrades that is not consistent with a normal service start.
Had the same issue. This is what worked for me:
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /var/lib/mysql
sudo apt-get install mariadb-server
Backup /var/lib/mysql folder, as all data in will be deleted
Perhaps the answer is "The MySQL installation procedure creates the time zone tables in the mysql database, but does not load them. You must do so manually using the following instructions..."
See Manual page.
You may choose to file a bug report about the installation error, too.
I somehow have messed up my MySQL on my Ubuntu server and cannot fix it. I have tried every single combination of apt-get remove --purge mysql-server, apt-get autoremove, apt-get purge, Googled for hours and nothing.
I have literally given up. Every time I try to reinstall I get error. I've had enough. I want to remove every single file associated with MySQL on my server.
I get this error every time I try to reinstall which seems to be common but not one "fix" has worked for me. I need to clean my system of everything MySQL.
Unable to set password for the MySQL "root" user
An error occurred while setting the password for the MySQL administrative user. This may have happened because the account already has a password, or
because of a communication problem with the MySQL server.
You should check the account's password after the package installation.
Please read the /usr/share/doc/mysql-server-5.5/README.Debian file for more information.
Please can someone give me a set of command to purge this ungodly database from my system before I do a fresh install of the server.
Setting up mysql-server-5.5 (5.5.38-0ubuntu0.14.04.1) ...
140811 10:56:44 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package 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 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.
Processing triggers for libc-bin (2.19-0ubuntu6.1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
I have literally tried everything. Every single mysql file is removed and it still will not install properly.
To completly remove Mysql from Ubuntu :
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
after this, if you are having issues with re installing, Try to remove Mysql files in :
sudo rm -rf /var/lib/mysql
I experienced a similar issue on Ubuntu 14.04 LTS after a MySQL update.
I started getting error: "Fatal error: Can't open and lock privilege tables: Incorrect file format 'user'" in /var/log/mysql/error.log
MySQL could not start.
I resolved it by removing the following directory: /var/lib/mysql/mysql
sudo rm -rf /var/lib/mysql/mysql
This leaves your other DB related files in place, only removing the mysql related files.
After running these:
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
Then reinstalling mysql:
sudo apt-get install mysql-server
It worked perfectly.
Different solution for those still having issues. Hopefully I can help those trying to reinstall Mysql. Note, It's a seek and destroy mission. So be weary. Assuming your root:
apt-get purge mysql*
apt-get purge dbconfig-common #the screen used for mysql password
find / -name *mysql* #delete any traces of mysql
#insert apt-get cleanups, autoremove,updates etc.
Originally, something leftover was interfering with my startup of mysqlserver-5.5. These commands ended up resolving the issue for myself.
The following works:
sudo apt-get --purge remove mysql-client mysql-server mysql-common
sudo apt-get autoremove
Use apt to uninstall and remove all MySQL packages:
$ sudo apt-get remove --purge mysql-server mysql-client mysql-common -y
$ sudo apt-get autoremove -y
$ sudo apt-get autoclean
Remove the MySQL folder:
$ rm -rf /etc/mysql
Delete all MySQL files on your server:
$ sudo find / -iname 'mysql*' -exec rm -rf {} \;
Your system should no longer contain default MySQL related files.
sudo apt-get remove --purge mysql*
Remove the MySQL packages fully from the target system.
sudo apt-get purge mysql*
Remove all mysql related configuration files.
sudo apt-get autoremove
Clean up unused dependencies using autoremove command.
sudo apt-get autoclean
To clear all local repository in the target system.
sudo apt-get remove dbconfig-mysql
If you also want to delete your local/config files for dbconfig-mysql then this will work.
This is what saved me. Apparently the depackager tries to put things in the wrong tmp folder.
https://askubuntu.com/a/248860
Remove /etc/my.cnf file and retry the installation, it worked for me for exactly same problem. :-)
remove mysql :
sudo apt -y purge mysql*
sudo apt -y autoremove
sudo rm -rf /etc/mysql
sudo rm -rf /var/lib/mysql*
Restart instance :
sudo shutdown -r now
I just had this same issue. It turns out for me, mysql was already installed and working. I just didn't know how to check.
$ ps aux | grep mysql
This will show you if mysql is already running. If it is it should return something like this:
mysql 24294 0.1 1.3 550012 52784 ? Ssl 15:16 0:06 /usr/sbin/mysqld
gwang 27451 0.0 0.0 15940 924 pts/3 S+ 16:34 0:00 grep --color=auto mysql