Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Error when apt-get install mysql-server
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Error when apt-get install mysql-server

jrdaijrdai Member
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
Setting up heirloom-mailx (12.5-2) ...
update-alternatives: using /usr/bin/heirloom-mailx to provide /usr/bin/mailx (mailx) in auto mode
Setting up libhtml-template-perl (2.91-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)

It gave that when I use apt-get to install MySQL after a fresh OS install (Debian 7). Please help!

Comments

  • Try apt-get install -f

    If that doesn't fix the dependency's purge MySQL and reinstall.

    apt-get --purge mysql*

    apt-get install mysql-server

  • blackblack Member

    what does your /etc/apt/sources.list look like?

  • jrdaijrdai Member
    deb http://ftp.debian.org/debian wheezy main contrib non-free
    deb http://security.debian.org wheezy/updates main contrib non-free
  • jrdaijrdai Member

    I tried the solution from here:http://stackoverflow.com/questions/13276088/cant-start-mysql5-5-on-ubuntu-12-04-dpkg-dependency-problems

    But it does not work for me. BTW, there are errors before shows the above errors:

    140307  7:18:39 [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.
    140307  7:18:39 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
    140307  7:18:39 [Note] Plugin 'FEDERATED' is disabled.
    140307  7:18:39 InnoDB: The InnoDB memory heap is disabled
    140307  7:18:39 InnoDB: Mutexes and rw_locks use GCC atomic builtins
    140307  7:18:39 InnoDB: Compressed tables use zlib 1.2.7
    140307  7:18:39 InnoDB: Using Linux native AIO
    140307  7:18:39  InnoDB: Warning: io_setup() failed with EAGAIN. Will make 5 attempts before giving up.
    InnoDB: Warning: io_setup() attempt 1 failed.
    InnoDB: Warning: io_setup() attempt 2 failed.
    InnoDB: Warning: io_setup() attempt 3 failed.
    InnoDB: Warning: io_setup() attempt 4 failed.
    InnoDB: Warning: io_setup() attempt 5 failed.
    140307  7:18:41  InnoDB: Error: io_setup() failed with EAGAIN after 5 attempts.
    InnoDB: You can disable Linux Native AIO by setting innodb_use_native_aio = 0 in my.cnf
    140307  7:18:41 InnoDB: Fatal error: cannot initialize AIO sub-system
    140307  7:18:41 [ERROR] Plugin 'InnoDB' init function returned error.
    140307  7:18:41 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
    140307  7:18:41 [ERROR] Unknown/unsupported storage engine: InnoDB
    140307  7:18:41 [ERROR] Aborting
    

    And then a screen pop up saying Unable to set password for the MySQL "root" user. Then came this

    [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)
    
  • http://forum.openvz.org/index.php?t=msg&goto=44068&;

    Because google is just too difficult

    I ran into the same issue and was able to work around it. There are two solutions I found.

    Disable AIO in all containers' my.cnf files by adding "innodb_use_native_aio=0"

    Increase the global limit for the server in "/proc/sys/fs/aio-max-nr"

  • Before, I have spent days trying to fresh install mysql-server with this problem but without luck. It's because the dialog-like package not installed from the start (Solus template). That also explain why you unable to set password for the MySQL "root" user.

    Please see http://kb.parallels.com/en/117251

    Fresh container based on Debian 7 template does not have any dialog-like package installed (dialog, whiptail) which makes it impossible to properly configure any package inside container, which requires interactive configuration during installation.

    But if mysql-server already installed @TheRedFox is the best answer.

  • IceCreamIceCream Member
    edited March 2014

    Just wget dialog then from the repo and install it via "installpkg dialog*.txz". After that you'll be able to install mysqld.

    Edit: Sorry I misread the topic :x Just apt-get it.

  • As I remember apt-get dialog or whiptail won't fix the problem. But I just noobs.

  • Read here: https://www.kernel.org/doc/Documentation/sysctl/fs.txt (ctrl+f within the page for aio-max-nr)

    Run the following command in SSH with sudo or as a root: sysctl -a |grep aio
    Paste here what you get back from the above command.

    If fs.aio-nr excceeds fs.aio-max-nr then you're in trouble; you may try to increase the fs.aio-max-nr.
    Also if you're not going to use InnoDB storage engine you may disable it by adding the following to /etc/mysql/my.cnf file in [mysqld] section:

    # For low memory, InnoDB should not be used so keep skip-innodb uncommented unless required
    # skip-innodb - deprecated
    ignore-builtin-innodb
    default-storage-engine = myisam
    
  • jrdaijrdai Member
    edited March 2014

    @lewekleonek

    #sysctl -a |grep aio
    root@wlstx:~# sysctl -a |grep aio
    sysctl: separators should not be repeated: /.fake
    sysctl: separators should not be repeated: /.fake
    fs.aio-nr = 65526
    fs.aio-max-nr = 65536

    InnoDB disabled following your instruction, but the problem still

    # service mysql start 
    [FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!

    TheRedFox said: Disable AIO in all containers' my.cnf files by adding "innodb_use_native_aio=0"

    Increase the global limit for the server in "/proc/sys/fs/aio-max-nr"

    The aio-max-nr is 65536, I added "innodb_use_native_aio=0" to my.conf ([mysqld] block I assumed), "Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!"

    Noerman said: It's because the dialog-like package not installed from the start (Solus template). That also explain why you unable to set password for the MySQL "root" user.

    Please see http://kb.parallels.com/en/117251

    It seems it has to be done from the provider's end?

  • lewekleoneklewekleonek Member
    edited March 2014

    1) Re-enable InnoDB; it may be needed because you may have some InnoDB tables in your database, so remove the following lines from your my.cnf file:

    # For low memory, InnoDB should not be used so keep skip-innodb uncommented unless required
    # skip-innodb - deprecated
    ignore-builtin-innodb
    default-storage-engine = myisam
    

    2) As a root, run the following command (which will increase the fs.aio-max-nr, it has to be bigger than fs.aio-nr) :

    echo 1048576 > /proc/sys/fs/aio-max-nr
    

    The above is not going to stick when you re-boot the operating system, but we'll worry about this later

    3) Try to start mysqld again

    Let us know what happened.

  • jrdaijrdai Member

    Thank you lewekleonek. But running the second command gave:

    root@wlstx:~# echo 1048576 > /proc/sys/fs/aio-max-nr
    -bash: /proc/sys/fs/aio-max-nr: Permission denied

    I am already root, but still got a permission denied?

  • Dear everyone, as I aware that the installation not finished yet due unable to save root password, so any config modification won't be helpful. @jrdai you need to inform your vps provider that your Debian template went wrong. That it!

    jrdai said: I am already root, but still got a permission denied?

    You don't have the permission, even you are root. It's your provider that have the power.

  • lewekleoneklewekleonek Member
    edited March 2014

    Looks like we're running here out of options.
    Last thing before you contact your provider:
    Edit /etc/sysctl.conf file as a root and append the following line to this config file:

    fs.aio-max-nr=1048576
    

    After that run:

    sysctl -p /etc/sysctl.conf
    

    If the above does not work - restart the server and try to start mysqld again.
    Run sysctl -a |grep aio and post the output (to confirm that aio-max-nr was increased).

  • jrdaijrdai Member

    Thank you @lewekleonek, very helpful for me being nearly desperate. I've contacted the provider, and now

    # sysctl -a |grep aio 
    sysctl: separators should not be repeated: /.fake
    sysctl: separators should not be repeated: /.fake
    fs.aio-nr = 90755
    fs.aio-max-nr = 9965536
    root@wlstx:~# service mysql status
    [info] MySQL is stopped..
    root@wlstx:~# service mysql start 
    [ ok ] Starting MySQL database server: mysqld.
    [info] Checking for tables which need an upgrade, are corrupt or were 
    not closed cleanly..
    root@wlstx:~# ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)
  • Looks much better now.

    First try to reconfigure mysql server:

    dpkg-reconfigure myslq-server
    

    If the above does not work, i.e. it won't ask you to set debian-sys-maint password, then re-install the packages from scratch:

    apt-get purge mysql*
    apt-get install mysql-server
    
  • jrdaijrdai Member

    I removed all the mysql application again, then installed again and it seems working, but just one info

    [ ok ] Starting MySQL database server: mysqld ..
    [info] Checking for tables which need an upgrade, are corrupt or were 
    not closed cleanly..
    Setting up mysql-server (5.5.35+dfsg-0+wheezy1) ...

    I did "mysqlcheck --all-databases --repair -u root -p", but it still gave that :(

    # service mysql restart
    sh: 0: getcwd() failed: No such file or directory
    [ ok ] Stopping MySQL database server: mysqld.
    [ ok ] Starting MySQL database server: mysqld ..
    [info] Checking for tables which need an upgrade, are corrupt or were 
    not closed cleanly..
  • Remove mysql-server package again, but make sure you run the apt-get purge mysql-server when doing that.
    Just in case see if there are any files left behind in /var/lib/mysql - clean out this directory before you re-install mysql-server.

  • jrdaijrdai Member

    @lewekleonek said:
    Remove mysql-server package again, but make sure you run the apt-get purge mysql-server when doing that.
    Just in case see if there are any files left behind in /var/lib/mysql - clean out this directory before you re-install mysql-server.

    I did just exactly that, and gave "Checking for tables which need an upgrade, are corrupt or were
    not closed cleanly.." which seemed to be unable to fix

  • @jrdai AFAIK it's normal. It's only checking for errors.

  • Oh yeah... that's right... I'm too tired to think well...
    It's [info] message only. You're good to go. Make sure you back-up your database frequently.

    Thanked by 1jrdai
Sign In or Register to comment.