[chroot] MySQL ne démarre plus

MySQL ne démarre plus [chroot] - Logiciels - Linux et OS Alternatifs

Marsh Posté le 15-07-2010 à 21:09:27    

Bonjour,
 
Avant je faisais tourner MySQL (chrooté) sur une Lenny 32 bits, dernièrement je l'ai migré sur une 64 et les problèmes ont commencé ...
J'ai utilisé le même tuto en adaptant les bibliothèques 32/64.
Voici l'erreur au démarrage du service :

grep mysqld /var/log/syslog | tail
Jul 15 20:38:45 sql mysqld_safe[1529]: started
Jul 15 20:38:45 sql mysqld[1533]: 100715 20:38:45 [ERROR] Fatal error: Can't change to run as user 'mysql' ;  Please check that the user exists!
Jul 15 20:38:45 sql mysqld[1533]:  
Jul 15 20:38:45 sql mysqld[1533]: 100715 20:38:45 [ERROR] Aborting
Jul 15 20:38:45 sql mysqld[1533]:  
Jul 15 20:38:45 sql mysqld[1533]: 100715 20:38:45 [Note] /usr/sbin/mysqld: Shutdown complete
Jul 15 20:38:45 sql mysqld[1533]:  
Jul 15 20:38:45 sql mysqld_safe[1535]: ended
Jul 15 20:38:59 sql /etc/init.d/mysql[1670]: error: 'Can't connect to local MySQL server through socket '/var/chroot/mysql/var/run/mysqld/mysqld.sock' (2)'
Jul 15 20:38:59 sql /etc/init.d/mysql[1670]: Check that mysqld is running and that the socket: '/var/chroot/mysql/var/run/mysqld/mysqld.sock' exists!


L'utilisateur mysql existe bien !

useradd -g mysql mysql
useradd: user mysql exists

groupadd mysql
groupadd: group mysql exists


 
Help me :(

Reply

Marsh Posté le 15-07-2010 à 21:09:27   

Reply

Marsh Posté le 19-07-2010 à 02:42:44    

cat du mysql.err dans le repertoire data de ton install ?

Reply

Marsh Posté le 19-07-2010 à 12:56:31    

Malheureusement ce fichier est vide.
 
Merci pour ton aide ;).

Reply

Marsh Posté le 25-07-2010 à 12:10:45    

Si ça peut aider à identifier mes erreurs, voici ce que j'ai fait pour mettre en place le chroot :

  # invoke-rc.d mysql stop
  # mkdir -p /var/chroot/mysql/{etc,lib,lib64,tmp,usr/lib,usr/share,var/lib,var/log/mysql,var/run}
  # grep '^mysql:' /etc/passwd > /var/chroot/mysql/etc/passwd
  # cp /etc/localtime /var/chroot/mysql/etc/
  # echo -e "127.0.0.1\tlocalhost\n10.1.1.201\tweb.localdomain web\n10.1.1.202\tsql.localdomain sql" > /var/chroot/mysql/etc/hosts
  # mv /var/lib/mysql /var/chroot/mysql/var/lib/
  # ln -s /var/chroot/mysql/var/lib/mysql/ /var/lib/mysql
  # mv /var/run/mysqld /var/chroot/mysql/var/run/
  # ln -s /var/chroot/mysql/var/run/mysqld/ /var/run/mysqld
  # mv /usr/share/mysql /var/chroot/mysql/usr/share/
  # ln -s /var/chroot/mysql/usr/share/mysql/ /usr/share/mysql
  # chown mysql:mysql /var/chroot/mysql/var/lib/mysql
  # chown mysql:adm /var/chroot/mysql/var/log/mysql
  # chown mysql:root /var/chroot/mysql/var/run/mysqld
  # chmod 2750 /var/chroot/mysql/var/log/mysql/
  # chmod 1777 /var/chroot/mysql/tmp/
  # touch /var/chroot/mysql/var/log/mysql.{err,log}
  # chmod 640 /var/chroot/mysql/var/log/mysql.{err,log}
  # chown root:adm /var/chroot/mysql/var/log/mysql.err
  # chown mysql:adm /var/chroot/mysql/var/log/mysql.log
  # ldd /usr/sbin/mysqld
        linux-vdso.so.1 =>  (0x00007fffffffe000)
        librt.so.1 => /lib/librt.so.1 (0x00007f27d7ff7000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00007f27d7de0000)
        libwrap.so.0 => /lib/libwrap.so.0 (0x00007f27d7bd7000)
        libdl.so.2 => /lib/libdl.so.2 (0x00007f27d79d3000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00007f27d77b7000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x00007f27d757f000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x00007f27d7367000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f27d705b000)
        libm.so.6 => /lib/libm.so.6 (0x00007f27d6dd8000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f27d6bc1000)
        libc.so.6 => /lib/libc.so.6 (0x00007f27d686e000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f27d8200000)
  # cp /lib64/ld-linux-x86-64.so.2 /var/chroot/mysql/lib64/
  # cp /usr/lib/libz.so.1 /usr/lib/libstdc++.so.6 /var/chroot/mysql/usr/lib/
  # cp /lib/librt.so.1 /lib/libwrap.so.0 /lib/libdl.so.2 /lib/libpthread.so.0 /lib/libcrypt.so.1 /lib/libnsl.so.1 /lib/libm.so.6 /lib/libgcc_s.so.1 /lib/libc.so.6 /var/chroot/mysql/lib/
  # vim /etc/mysql/debian.cnf
  socket   = /var/chroot/mysql/var/run/mysqld/mysqld.sock
  # vim /etc/mysql/my.cnf
  [client]
  socket   = /var/chroot/mysql/var/run/mysqld/mysqld.sock
  [mysqld]
  chroot   = /var/chroot/mysql/
  # invoke-rc.d mysql start


Message édité par Gavrinis le 25-07-2010 à 12:13:08
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed