Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Can't start/configure/reinstall/uninstall MysSQL server

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
guzabi
Posts: 9
Joined: 2016-01-07 12:03

Can't start/configure/reinstall/uninstall MysSQL server

#1 Post by guzabi »

Hi all,
I'm running in a strange problem with MySQL 5.5 on Debian 7.11 Wheezy. After a system update, MySQL server refused tu launch.
Rebooting the server didn't change anything. I'm thinking config error but :

Code: Select all

$ dpkg-reconfigure mysql-server
/usr/sbin/dpkg-reconfigure: mysql-server is broken or not fully installed

Code: Select all

$ sudo dpkg --configure mysql-server-5.5
Setting up mysql-server-5.5 (5.5.54-0+deb7u2) ...
[ ok ] Stopping MySQL database server: mysqld.
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . 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
Errors were encountered while processing:
 mysql-server-5.5
So I thought "what the heck, I'll reinstall everything, but…

Code: Select all

$ sudo apt-get install --reinstall mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 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.
E: Internal Error, No file name for mysql-server:amd64
Whaaaaaaat? No mysql-server package? But, but…

Code: Select all

$ dpkg -l | grep mysql
ii  libdbd-mysql-perl                  4.021-1+deb7u2                 amd64        Perl5 database interface to the MySQL database
rc  libmysqlclient16                   5.1.73-1                       amd64        MySQL database client library
ii  libmysqlclient18:amd64             5.5.54-0+deb7u2                amd64        MySQL database client library
ii  mysql-client                       5.5.54-0+deb7u2                all          MySQL database client (metapackage depending on the latest version)
ii  mysql-client-5.5                   5.5.54-0+deb7u2                amd64        MySQL database client binaries
ii  mysql-common                       5.5.54-0+deb7u2                all          MySQL database common files, e.g. /etc/mysql/my.cnf
iU  mysql-server                       5.5.54-0+deb7u2                all          MySQL database server (metapackage depending on the latest version)
rc  mysql-server-5.1                   5.1.73-1                       amd64        MySQL database server binaries and system database setup
iF  mysql-server-5.5                   5.5.54-0+deb7u2                amd64        MySQL database server binaries and system database setup
ii  mysql-server-core-5.5              5.5.54-0+deb7u2                amd64        MySQL database server binaries
ii  php5-mysql                         5.4.45-0+deb7u7                amd64        MySQL module for php5
I have no exotic repo in sources.list, so I really don't know how to sort this out.
Somebody has an idea? Please...

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: Can't start/configure/reinstall/uninstall MysSQL server

#2 Post by kedaha »

But your terminal output shows: mysql-server is broken or not fully installed
Try running:
# aptitude install -f

Code: Select all

     -f
           Try hard to fix the dependencies of broken packages, even if it
           means ignoring the actions requested on the command line.

           This corresponds to the configuration item Aptitude::CmdLine::Fix-
           Broken.
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Can't start/configure/reinstall/uninstall MysSQL server

#3 Post by debiman »

1) it says two packages are not fully installed. what's the other one?

2) at this point:

Code: Select all

    $ sudo dpkg --configure mysql-server-5.5
    Setting up mysql-server-5.5 (5.5.54-0+deb7u2) ...
    [ ok ] Stopping MySQL database server: mysqld.
    [FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . 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
    Errors were encountered while processing:
     mysql-server-5.5
you should have investigated more.
i personally would have at least issued

Code: Select all

systemctl status mysql # (or mysqld or mysql-server)
3) this:

Code: Select all

E: Internal Error, No file name for mysql-server:amd64
is not the same as "no mysql package".

guzabi
Posts: 9
Joined: 2016-01-07 12:03

Re: Can't start/configure/reinstall/uninstall MysSQL server

#4 Post by guzabi »

Hello,

Thanks for your answers. And sorry if I did not properly investigate, I really don't know exactly how to do it :?

So here goes. kedaha, I did try to fix packages, but it does not work :

Code: Select all

$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-5.5 (5.5.54-0+deb7u2) ...
[ ok ] Stopping MySQL database server: mysqld.
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . 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)
Plus this takes an awful lot of time (about 2 minutes) when stopping MySQL and starting MySQL.

Then debiman : I do not know what other package is not installed. How do I know that?
Can you tell me how to investigate more? I do not seem to have systemctl installed, but :

Code: Select all

$ sudo service mysql status
[info] MySQL is stopped..


And then, I have no idea what the "no file name" error actually means, so I'm sorry if I thought that meant no package.
Once again, sorry. I'm not a really good sysadmin, I know, please bear with me :?

My goal is to get back a functional MySQL server and NOT lose existing DB's…
Please, please, can you help ? Thanks in advance.

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 13 times
Been thanked: 66 times

Re: Can't start/configure/reinstall/uninstall MysSQL server

#5 Post by dilberts_left_nut »

Code: Select all

rc  mysql-server-5.1                   5.1.73-1
You still have config files for 5.1 installed.
AdrianTM wrote:There's no hacker in my grandma...

guzabi
Posts: 9
Joined: 2016-01-07 12:03

Re: Can't start/configure/reinstall/uninstall MysSQL server

#6 Post by guzabi »

Yeah, I saw that (though can't figure why).
Do you have a clue as to how I could remove it?
apt-get remove claims it's not there and just tries to configure 5.5 (which fails) :

Code: Select all

$ sudo apt-get remove mysql-server-5.1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'mysql-server-5.1' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-5.5 (5.5.54-0+deb7u2) ...
[ ok ] Stopping MySQL database server: mysqld.
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . 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)

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 13 times
Been thanked: 66 times

Re: Can't start/configure/reinstall/uninstall MysSQL server

#7 Post by dilberts_left_nut »

man apt-get wrote:

Code: Select all

       purge
           purge is identical to remove except that packages are removed and purged (any configuration files are deleted too).
AdrianTM wrote:There's no hacker in my grandma...

guzabi
Posts: 9
Joined: 2016-01-07 12:03

Re: Can't start/configure/reinstall/uninstall MysSQL server

#8 Post by guzabi »

Yes. But no :

Code: Select all

$ sudo apt-get purge mysql-server-5.1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  mysql-server-5.1*
0 upgraded, 0 newly installed, 1 to remove and 2 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
(Reading database ... 53616 files and directories currently installed.)
Removing mysql-server-5.1 ...
Purging configuration files for mysql-server-5.1 ...
Setting up mysql-server-5.5 (5.5.54-0+deb7u2) ...
[ ok ] Stopping MySQL database server: mysqld.
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . 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)
What if I purge mysql-server-5.5 and then reinstall it?
Will it delete existing databases?

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 13 times
Been thanked: 66 times

Re: Can't start/configure/reinstall/uninstall MysSQL server

#9 Post by dilberts_left_nut »

I wouldn't expect so.
AdrianTM wrote:There's no hacker in my grandma...

guzabi
Posts: 9
Joined: 2016-01-07 12:03

Re: Can't start/configure/reinstall/uninstall MysSQL server

#10 Post by guzabi »

Okay. But this does not work either :

Code: Select all

$ sudo apt-get remove --purge mysql-server-core-5.5
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 
$ sudo apt-get purge mysql-server-5.5
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
dpkg --configure -a will fail, of course, because that is the problem : incomplete config.
I'm pretty stuck, here.
Anyone has an idea of how to get un-stuck?
Thanks in advance…

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 13 times
Been thanked: 66 times

Re: Can't start/configure/reinstall/uninstall MysSQL server

#11 Post by dilberts_left_nut »

Looks messy.
You'd better read "man dpkg".
AdrianTM wrote:There's no hacker in my grandma...

dcihon
Posts: 279
Joined: 2012-09-23 16:18
Been thanked: 3 times

Re: Can't start/configure/reinstall/uninstall MysSQL server

#12 Post by dcihon »

Backup your databases.
Re install system.

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: Can't start/configure/reinstall/uninstall MysSQL server

#13 Post by kedaha »

Use locate to find where all the mysql server files are; for example
$ locate mysql-server-core
$ locate mysql
After stopping the process, you can manually remove all the mysql server stuff prior to reinstalling.
After removing files, run:
updatedb
By the way, under no circumstances remove any files from /var/lib/dpkg/info/
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

guzabi
Posts: 9
Joined: 2016-01-07 12:03

Re: Can't start/configure/reinstall/uninstall MysSQL server

#14 Post by guzabi »

Hi all,

First of all, thanks for the effort and for bearing with my limited sysadmin competences.
Also, backup the DBs and reinstall the machine would be a last resort measure and lead to huge amount of trouble.
So I'd rather try not to do that.

I have 3 questions for you, kedaha (or anyone else, btw) :
1. locating and deleting seems fine, but what should I delete? All server files? Can you try to give me a list of packages I should look for?
I have posted a list of installed mysql packages, I reprint it here under.
2. Stopping the service is a problem : service status returns STOPPED, ps aux returns no mysql instance, but every time I try something, dpkg says it's stopping MySQL and that returns OK but takes almost 2 minutes. What is cooking in this jar?
3. Why does sudo apt-get install --reinstall mysql-server return "E: Internal Error, No file name for mysql-server:amd64"? What is corrupted and where?

Thanks a lot in advance, any help appreciated.

Code: Select all

$ dpkg -l | grep mysql
ii  libdbd-mysql-perl                  4.021-1+deb7u2                 amd64        Perl5 database interface to the MySQL database
rc  libmysqlclient16                   5.1.73-1                       amd64        MySQL database client library
ii  libmysqlclient18:amd64             5.5.54-0+deb7u2                amd64        MySQL database client library
ii  mysql-client                       5.5.54-0+deb7u2                all          MySQL database client (metapackage depending on the latest version)
ii  mysql-client-5.5                   5.5.54-0+deb7u2                amd64        MySQL database client binaries
ii  mysql-common                       5.5.54-0+deb7u2                all          MySQL database common files, e.g. /etc/mysql/my.cnf
iU  mysql-server                       5.5.54-0+deb7u2                all          MySQL database server (metapackage depending on the latest version)
rc  mysql-server-5.1                   5.1.73-1                       amd64        MySQL database server binaries and system database setup
iF  mysql-server-5.5                   5.5.54-0+deb7u2                amd64        MySQL database server binaries and system database setup
ii  mysql-server-core-5.5              5.5.54-0+deb7u2                amd64        MySQL database server binaries
ii  php5-mysql                         5.4.45-0+deb7u7                amd64        MySQL module for php5

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: Can't start/configure/reinstall/uninstall MysSQL server

#15 Post by kedaha »

Take a look at: how-to-remove-mysql-completely-with-config-and-library-files, which gives more details.
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

guzabi
Posts: 9
Joined: 2016-01-07 12:03

Re: Can't start/configure/reinstall/uninstall MysSQL server

#16 Post by guzabi »

Hello all !

Me again. Turns out the solution was both simple and not elegant.
I noticed that the ibdata1 file was over 1 Gb, which is strange but ok.
So I just did this :

Code: Select all

$ sudo rm -Rf /var/lib/mysql/ibdata* /var/lib/mysql/ib_* 
$ sudo dpkg --configure -a 
and everything was ok. I was hen able to restart mysql server and all services.
Now the update seems complete :

Code: Select all

$ sudo dpkg -l | grep mysql
ii  libdbd-mysql-perl                  4.021-1+deb7u2                 amd64        Perl5 database interface to the MySQL database
rc  libmysqlclient16                   5.1.73-1                       amd64        MySQL database client library
ii  libmysqlclient18:amd64             5.5.54-0+deb7u2                amd64        MySQL database client library
ii  mysql-client                       5.5.54-0+deb7u2                all          MySQL database client (metapackage depending on the latest version)
ii  mysql-client-5.5                   5.5.54-0+deb7u2                amd64        MySQL database client binaries
ii  mysql-common                       5.5.54-0+deb7u2                all          MySQL database common files, e.g. /etc/mysql/my.cnf
ii  mysql-server                       5.5.54-0+deb7u2                all          MySQL database server (metapackage depending on the latest version)
ii  mysql-server-5.5                   5.5.54-0+deb7u2                amd64        MySQL database server binaries and system database setup
ii  mysql-server-core-5.5              5.5.54-0+deb7u2                amd64        MySQL database server binaries
ii  php5-mysql                         5.4.45-0+deb7u7                amd64        MySQL module for php5
Now everything seems ok.

Please also notice that mysqldump can't run if the server is broken, so in order to backup the databases, I would have had to copy the .MYD and .MYI files manually. Recovery is painful with a server that did not have a clean shutdown. Anyway. I did not need that, so hooray ! :-)

Thanks all for your help.
I'd like to tell you I know how I can avoid a too large or corrupt ibdata1 file, but I don't (and Google doesn't seem to have a clear answer either).
Any input welcome :-)

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Can't start/configure/reinstall/uninstall MysSQL server

#17 Post by debiman »

take a note of this:
guzabi wrote:

Code: Select all

rc  libmysqlclient16                   5.1.73-1                       amd64        MySQL database client library
more residual config.
might become relevant if you get stuck again later.

guzabi
Posts: 9
Joined: 2016-01-07 12:03

Re: Can't start/configure/reinstall/uninstall MysSQL server

#18 Post by guzabi »

Absolutely, saw and corrected it (apt-get remove --purge mysqlclient16).
Not it's not in the list anymore.

Post Reply