Linux Logiciels



MySQL
Mêttre un mot de passe au compte root



Pour : Linux


Si vous ne voulez plus être connecté directement à MySQL sans taper de mot de passe:

# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 393 Server version: 5.1.49-3 (Debian) Copyright (c) 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>



Saisissez ceci avec les droits root dans le shell et non pas dans MySQL:

# mysqladmin password mot_de_passe_admin_pour_mysql


Exemple:

# mysqladmin -u root password tototiti


Maintenant vous ne serez plus connecté directement si vous tapez que "mysql":

# mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)


Il vous faudra maintenant tapez:

# mysql -u root -p Enter password: tototiti Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 410 Server version: 5.1.49-3 (Debian) Copyright (c) 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>


PS: C'est normal que le mot de passe ne s'affiche pas quand vous le saisissez, c'est une sécurité.


Par O.Cédric
Sur www.octetmalin.net

Article publié le:
07/06/2011 08:55






Cette page vous à plus?

Dîtes que vous l'aimez en cliquant sur le bouton Facebook.