My server hard disk crashed and unfortunately my MySQL backup (which occurs once a day) was missing some important data, but I have the files from the folder /var/lib/mysql
.
On my new installation on Ubuntu 16.4, I installed MySQL successfully and attempted to copy the files from the old /var/lib/mysql
to the new installation, however I encountered issues and decided to reinstall MySQL.
I've followed these instructions to fully uninstall and reinstall MySQL, however now when I try to install MySQL I see this output:
user@computer:~$ sudo apt-get install mysql-server mysql-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed
mysql-client mysql-server
0 to upgrade, 2 to newly install, 0 to remove and 0 not to upgrade.
Need to get 0 B/20.2 kB of archives.
After this operation, 317 kB of additional disk space will be used.
Selecting previously unselected package mysql-client.
(Reading database ... 213412 files and directories currently installed.)
Preparing to unpack .../mysql-client_5.7.12-0ubuntu1_all.deb ...
Unpacking mysql-client (5.7.12-0ubuntu1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.7.12-0ubuntu1_all.deb ...
Unpacking mysql-server (5.7.12-0ubuntu1) ...
Setting up mysql-client (5.7.12-0ubuntu1) ...
Setting up mysql-server (5.7.12-0ubuntu1) ...
However:
- No prompt comes up of any kind, asking about database configuration OR setting a password for the MySQL
root
user - No
/etc/mysql/
folder is created - No
/var/lib/mysql/
folder is created
When trying to uninstall mysql-common
, I see the following error:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies.
mysql-client : Depends: mysql-client-5.7 but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
How can I install MySQL correctly again with the prompts and correct folders, or how can I find the default /etc/mysql/
and /var/lib/mysql/
folder content to manually set it up?
mysql-common
. That package will create the/etc/mysql
folder, probably also/var/lib/mysql
once you have the server running. – Jos May 11 '16 at 08:48mysql-common
- I've added the output toapt-get purge mysql-common
to the original question. – Ben May 11 '16 at 08:51mysql-client
, then installdbconfig-mysql
, then uninstallmysql-client
andmysql-common
. Do you have any held packages in that area? (dodpkg -l | grep ^h
). – Jos May 11 '16 at 08:57dpkg -l | grep ^h
outputs nothing at all. If I try to removemysql-common
withmysql-client
installed, the unmet dependency isdbconfig-mysql
. If I try to remove it withoutmysql-client
installed, the unmet dependency ismysql-client
. If I try to installdbconfig-mysql
, it says that it is already the newest version. – Ben May 11 '16 at 09:01dbconfig-mysql
dependency was unmet, purgingdbconfig-mysql
actually removed the whole lot and I was able to reinstall and it's working! Thank you for pointing me in the right direction. – Ben May 11 '16 at 09:06