Stopping MySQL database server

Mon mysql server fonctionne mais l’init.d ne sert plus à rien depuis un upgrade wheezy de l’an passé.

[quote]root@kmcs:/home/kmc# /etc/init.d/mysql restart
[…] Stopping MySQL database server: mysqld/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf
failed!
[ ok ] Starting MySQL database server: mysqld already running.
[/quote]

Je viens de refaire un upgrade. mysql est passé à mysql-server-5.5_5.5.43-0+deb7u1_amd64.deb
mais toujours ce message à chaque boot. Ca fait sale. :12
Merci pour votre aide

[mono]Un[/mono], l’an ?

Bé vu la galère à chaque fois, j’avoue que je le fais le moins possible. C’est grave docteur ? :confused:

Non c’est pas dramatique c’est juste que le support est un peu moins efficace.
Sinon on peu écarter un pb avec systemd de la liste des suspect c’est déjà ça :mrgreen:
Déjà faire un stop au lieu d’un resart pour voir, même si je doute que ça fonctionne.
Ensuite Passer le script d’init en debug «set -x» et voir ce qui foire exactement

Avec le set -x j’obtiens

...
+ echo /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf
/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf
++ /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf shutdown
+ shutdown_out='/usr/bin/mysqladmin: connect to server at '\''localhost'\'' failed
error: '\''Access denied for user '\''debian-sys-maint'\''@'\''localhost'\'' (using password: YES)'\'''

J’en ai déduit qu’il fallait changer le pass debian-inst mais comment changer le pass sans pouvoir stopper le service mysql ?

Heureusement que c’est possible, je te laisse chercher un peu car c’est le meilleur moyen d’apprendre.
Tu n’est pas le seul a avoir eu ce pb, en recherchant ton message d’erreur sur un moteur bien connu tu trouve TRÈS rapidement la solution.

Merci pour le tuyau Google pédagogue ! Vous parlez sans doute de ce genre de solution:

reinitialiser-le-mot-de-passe-root-sur-mysql-t35826.html

ou

eole.orion.education.fr/oldwiki/ … t_password

[quote]root@kmcs:/home/kmc# mysql
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)
root@kmcs:/home/kmc# service mysql stop
[…] Stopping MySQL database server: mysqld/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf
failed!
root@kmcs:/home/kmc# ps aux|grep mysql
root 3050 0.0 0.0 4192 1460 ? S 15:04 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 3378 0.1 0.6 364096 54092 ? Sl 15:04 0:02 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
root 3379 0.0 0.0 4100 1432 ? S 15:04 0:00 logger -t mysqld -p daemon.error
kmc 4464 0.0 0.4 335716 34844 ? Sl 15:04 0:01 /usr/sbin/mysqld --defaults-file=/home/kmc/.local/share/akonadi/mysql.conf --datadir=/home/kmc/.local/share/akonadi/db_data/ --socket=/home/kmc/.local/share/akonadi/socket-kmcs/mysql.socket
root 20146 0.0 0.0 7864 1820 pts/1 S+ 15:37 0:00 grep mysql
[/quote]

Pas forcément :
bfy.tw/W0k
mirzmaster.wordpress.com/2009/0 … localhost/

Alors j’ai effectivement obtenu une amélioration en changeant le pass debian-install mais maintenant le stop passe mais c’est le start qui bloque:

root@kmcs:/home/kmc# service mysql restart
[ ok ] Stopping MySQL database server: mysqld.
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!

root@kmcs:/home/kmc# tail -66f /var/log/mysql.log
Jun 26 18:53:25 kmcs mysqld: 150626 18:53:25 [Note] /usr/sbin/mysqld: Normal shutdown
Jun 26 18:53:25 kmcs mysqld: 
Jun 26 18:53:25 kmcs mysqld: 150626 18:53:25 [Note] Event Scheduler: Purging the queue. 0 events
Jun 26 18:53:27 kmcs mysqld: 150626 18:53:27 [Warning] /usr/sbin/mysqld: Forcing close of thread 7  user: 'kmc'
Jun 26 18:53:27 kmcs mysqld: 
Jun 26 18:53:27 kmcs mysqld: 150626 18:53:27  InnoDB: Starting shutdown...
Jun 26 18:53:28 kmcs mysqld: 150626 18:53:28  InnoDB: Shutdown completed; log sequence number 590841093
Jun 26 18:53:28 kmcs mysqld: 150626 18:53:28 [Note] /usr/sbin/mysqld: Shutdown complete
Jun 26 18:53:28 kmcs mysqld: 
Jun 26 18:53:28 kmcs mysqld_safe: Starting mysqld daemon with databases from /var/lib/mysql
Jun 26 18:53:28 kmcs mysqld: 150626 18:53:28 [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.
Jun 26 18:53:28 kmcs mysqld: 150626 18:53:28 [Note] /usr/sbin/mysqld (mysqld 5.5.43-0+deb7u1) starting as process 12516 ...
Jun 26 18:53:28 kmcs mysqld: 150626 18:53:28 [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.
Jun 26 18:53:28 kmcs mysqld: 150626 18:53:28 [Note] Plugin 'FEDERATED' is disabled.
Jun 26 18:53:28 kmcs mysqld: 150626 18:53:28 InnoDB: The InnoDB memory heap is disabled
Jun 26 18:53:28 kmcs mysqld: 150626 18:53:28 InnoDB: Mutexes and rw_locks use GCC atomic builtins
Jun 26 18:53:28 kmcs mysqld: 150626 18:53:28 InnoDB: Compressed tables use zlib 1.2.7
Jun 26 18:53:28 kmcs mysqld: 150626 18:53:28 InnoDB: Using Linux native AIO
Jun 26 18:53:28 kmcs mysqld: 150626 18:53:28 InnoDB: Initializing buffer pool, size = 128.0M
Jun 26 18:53:28 kmcs mysqld: 150626 18:53:28 InnoDB: Completed initialization of buffer pool
Jun 26 18:53:28 kmcs mysqld: 150626 18:53:28 InnoDB: highest supported file format is Barracuda.
Jun 26 18:53:28 kmcs mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended
Jun 26 18:53:28 kmcs mysqld: 150626 18:53:28  InnoDB: Waiting for the background threads to start
Jun 26 18:53:29 kmcs mysqld: 150626 18:53:29 InnoDB: 5.5.43 started; log sequence number 590841093
Jun 26 18:53:29 kmcs mysqld: 150626 18:53:29 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
Jun 26 18:53:29 kmcs mysqld: 150626 18:53:29 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
Jun 26 18:53:29 kmcs mysqld: 150626 18:53:29 [Note] Server socket created on IP: '127.0.0.1'.
Jun 26 18:53:29 kmcs mysqld: 150626 18:53:29 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address
Jun 26 18:53:29 kmcs mysqld: 150626 18:53:29 [ERROR] Do you already have another mysqld server running on port: 3306 ?
Jun 26 18:53:29 kmcs mysqld: 150626 18:53:29 [ERROR] Aborting
Jun 26 18:53:29 kmcs mysqld: 
Jun 26 18:53:29 kmcs mysqld: 150626 18:53:29  InnoDB: Starting shutdown...
Jun 26 18:53:30 kmcs mysqld: 150626 18:53:30  InnoDB: Shutdown completed; log sequence number 590841093
Jun 26 18:53:30 kmcs mysqld: 150626 18:53:30 [Note] /usr/sbin/mysqld: Shutdown complete
Jun 26 18:53:30 kmcs mysqld: 
Jun 26 18:53:31 kmcs mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended
Jun 26 18:53:42 kmcs /etc/init.d/mysql[12811]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Jun 26 18:53:42 kmcs /etc/init.d/mysql[12811]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
Jun 26 18:53:42 kmcs /etc/init.d/mysql[12811]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Jun 26 18:53:42 kmcs /etc/init.d/mysql[12811]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Jun 26 18:53:42 kmcs /etc/init.d/mysql[12811]: 
^Croot@kmcs:/home/kmc# ps aux|grep  mysql
kmc       4434  0.0  0.4 336276 34956 ?        Sl   18:49   0:00 /usr/sbin/mysqld --defaults-file=/home/kmc/.local/share/akonadi/mysql.conf --datadir=/home/kmc/.local/share/akonadi/db_data/ --socket=/home/kmc/.local/share/akonadi/socket-kmcs/mysql.socket
root     13464  0.0  0.0   7864  2004 pts/1    S+   18:55   0:00 grep mysql
root@kmcs:/home/kmc# ll /var/run/mysqld/
total 0
root@kmcs:/home/kmc# netstat -lpn | grep mysql
unix  2      [ ACC ]     STREAM     LISTENING     16253    4434/mysqld         /home/kmc/.local/share/akonadi/socket-kmcs/mysql.socket

Mais j’ai remarqué au boot qu’il ya avait plus de process mysql:

root@kmcs:/home/kmc# ps aux|grep mysql root 3055 0.0 0.0 4192 1544 ? S 19:11 0:00 /bin/sh /usr/bin/mysqld_safe mysql 3417 3.5 1.0 448824 82624 ? Sl 19:11 0:02 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306 root 3418 0.0 0.0 4100 1268 ? S 19:11 0:00 logger -t mysqld -p daemon.error kmc 9888 0.2 0.4 336404 34932 ? Sl 19:11 0:00 /usr/sbin/mysqld --defaults-file=/home/kmc/.local/share/akonadi/mysql.conf --datadir=/home/kmc/.local/share/akonadi/db_data/ --socket=/home/kmc/.local/share/akonadi/socket-kmcs/mysql.socket root 10753 0.0 0.0 7864 1952 pts/1 S+ 19:12 0:00 grep mysql

Donc si je comprend bien, il y a un process mysql en trop après le boot. Quand je fais un restart ça stoppe un mysql mais il reste l’autre et le socket sur 3306 n’est plus accessible ?

Comment repérer qui lance ce deuxième process mysql / akonadi ?

Comme je te l’ai dit dans un autre fil, tu as deux serveurs qui tournent. Les sockets sont distinctes (/home/kmc/.local/share/akonadi/socket-kmcs/mysql.socket et /var/run/mysqld/mysqld.sock) par contre sans doute le port d’écoute n’a pas été changé et les deux sont en conflit sur ce port. Demandes toi comment est lancé le deuxième serveur. Tu avais répondu que ça ne te gênais pas mais ici tu sembles avoir changé d’avis.

Un process est lancé par init.d mais l’autre semble provenir de l’utilisateur local.

/usr/sbin/mysqld --defaults-file=/home/kmc/.local/share/akonadi/mysql.conf --datadir=/home/kmc/.local/share/akonadi/db_data/ --socket=/home/kmc/.local/share/akonadi/socket-kmcs/mysql.socket root@kmcs:/home/kmc# ll .kde/Autostart/ total 0

C’est quoi akonadi ?

Je ne vois pas comment pister le lancement de ce second process

Même en ayant tué tous les process mysql, mysql ne se lance pas:

root@kmcs:/home/kmc# ps aux|grep mysql
root      8991  0.0  0.0   5644   520 pts/2    S+   19:26   0:00 tail -66f /var/log/mysql.log
root     13706  0.0  0.0   7864  1956 pts/1    S+   19:35   0:00 grep mysql
 
root@kmcs:/home/kmc# /etc/init.d/mysql start
...
/mysqladmin: connect to server at '\''localhost'\'' failed
error: '\''Can'\''t connect to local MySQL server through socket '\''/var/run/mysqld/mysqld.sock'\'' (2)'\''
+ logger -p daemon.err -t /etc/init.d/mysql -i -p daemon.debug
Check that mysqld is running and that the socket: '\''/var/run/mysqld/mysqld.sock'\'' exists!\n'
 
root@kmcs:/home/kmc# tail -66f /var/log/mysql.log
/usr/sbin/mysqld, Version: 5.5.43-0+deb7u1-log ((Debian)). started with:
Tcp port: 3306  Unix socket: /var/run/mysqld/mysqld.sock
Time                 Id Command    Argument
/usr/sbin/mysqld, Version: 5.5.43-0+deb7u1-log 
 
root@kmcs:/home/kmc# ll /var/run/mysqld/
total 0
root@kmcs:/home/kmc# ps aux|grep mysql
root      8991  0.0  0.0   5644   520 pts/2    S+   19:26   0:00 tail -66f /var/log/mysql.log
root     13706  0.0  0.0   7864  1956 pts/1    S+   19:35   0:00 grep mysql

Au secours !

[quote=“kmchen”]C’est quoi [mono]akonadi[/mono] ?
[/quote]
Cela sous-entend, [mono]KDE[/mono].

Mais qu’est-ce que KDE aurait à faire avec MYSQL ?! D’autant que l’arrêt du process en trop ne permet pas plus de lancer MYSQL

Mais qu’est-ce que KDE aurait à faire avec MYSQL ?! D’autant que l’arrêt du process en trop ne permet pas plus de lancer MYSQL

root@kmcs:/home/kmc# netstat -lpn|grep mysql root@kmcs:/home/kmc# netstat -lpn|grep 3306

Allo. Il y a quelqu’un ?

Oui, mais on bosse…
Bon, quels sont les messages de syslog ou lorsque que tu lances le démon à la main

(En clair tu tapes en root «mysqld»)

Merci pour cette réponse. Voici:

[code]root@kmcs:/home/kmc# mysqld
150705 13:28: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.
150705 13:28:39 [Note] mysqld (mysqld 5.5.43-0+deb7u1-log) starting as process 9653 …
150705 13:28: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.
150705 13:28:39 [Note] Plugin ‘FEDERATED’ is disabled.
150705 13:28:39 InnoDB: The InnoDB memory heap is disabled
150705 13:28:39 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150705 13:28:39 InnoDB: Compressed tables use zlib 1.2.7
150705 13:28:39 InnoDB: Using Linux native AIO
150705 13:28:39 InnoDB: Initializing buffer pool, size = 128.0M
150705 13:28:39 InnoDB: Completed initialization of buffer pool
150705 13:28:39 InnoDB: highest supported file format is Barracuda.
150705 13:28:39 InnoDB: Waiting for the background threads to start
150705 13:28:40 InnoDB: 5.5.43 started; log sequence number 590841093
150705 13:28:40 [Note] Server hostname (bind-address): ‘127.0.0.1’; port: 3306
150705 13:28:40 [Note] - ‘127.0.0.1’ resolves to ‘127.0.0.1’;
150705 13:28:40 [Note] Server socket created on IP: ‘127.0.0.1’.
150705 13:28:40 [ERROR] Can’t start server: Bind on TCP/IP port: Cannot assign requested address
150705 13:28:40 [ERROR] Do you already have another mysqld server running on port: 3306 ?
150705 13:28:40 [ERROR] Aborting

150705 13:28:40 InnoDB: Starting shutdown…
150705 13:28:41 InnoDB: Shutdown completed; log sequence number 590841093
150705 13:28:41 [Note] mysqld: Shutdown complete

root@kmcs:/home/kmc# cat /var/log/mysql.log
mysqld, Version: 5.5.43-0+deb7u1-log ((Debian)). started with:
Tcp port: 3306 Unix socket: /var/run/mysqld/mysqld.sock
Time Id Command Argument

[/code]

Rien, nada, dans syslog.

C’est juste.
Pour ma part, auto-hébergement en prépa, …

[quote=“fran.b”]Oui, mais on bosse…
[/quote]
Et encore un prof qui va nous faire croire qu’il bosse un dimanche, de plus premier dimanche de leurs vacances de 60 jours …