Salut,
Étant en cours d’installation de mon serveur kimsufi, l’obligation de retrouver “Mes_petits_papiers” c’est fait ressentir ce jour !!!
Alors, je …
$ mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Mais pas de souci, ça va s’arrangeait …
# /etc/init.d/mysql stop
Démarrer le serveur MySQL en mode sans échec (sans mot de passe) :
:~# mysqld_safe --skip-grant-tables &
[1] 15840
root@ksxxxxxx:~# 111020 16:20:21 mysqld_safe Logging to syslog.
111020 16:20:21 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
La console reste en attente !!!
On se connecte au serveur MySQL comme « root » :
[code]mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.49-3 (Debian)
Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql>[/code]
Selectionner la BD named “mysql”
[code]mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql>
[/code]
Lancer une requête sur la table “user”
[code]mysql> select host,user,password from user;
±--------------------±-----------------±------------------------------------------+
| host | user | password |
±--------------------±-----------------±------------------------------------------+
| localhost | root | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| ksxxxxx.kimsufi.com | root | |
| 127.0.0.1 | root | |
| localhost | debian-sys-maint | *yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy |
±--------------------±-----------------±------------------------------------------+
4 rows in set (0.00 sec)
mysql> [/code]
Création d’un nouveau mot de passe pour root:
[color=#FF0000]/![/color] Remplacer UNIQUEMENT les caractères gras par votre MDP ! /!\
[quote]mysql> update user set password=PASSWORD(“MON_BIG_NOUVEAU_MOT_DE_PASS”) where User=‘root’;
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql>
[/quote]
Voilà, c’est fait ! Sortons proprement de la base.
[code]mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>
[/code]
mysql> quit;
Bye
root@ksxxxxxx:~#
On stop mysql (nous étions en mode sans échec) puis on redémarre.
root@ksxxxxxxx:~# /etc/init.d/mysql stop
Stopping MySQL database server: mysqld111020 16:37:52 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
.
[1]+ Done mysqld_safe --skip-grant-tables
root@ksxxxxxx:~#
root@ksxxxxxx:~# /etc/init.d/mysql start
Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..
root@ks39094:~#
C’est terminé !!!
Je suppose que vous avez taper un gros big mot de pass bien Hard … pas vrai hein ! Alors pour ne pas avoir à le retaper (ce big MDP) Fait comme moi …
Clic sur ce lien >>> Mysql : Ne plus taper son mot de pass (x) fois !
[code]root@ksxxxxxxx:~# mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 40
Server version: 5.1.49-3 (Debian)
Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql>
[/code]
ps : mysql> help Liste des commandes MySQL …
…