info:mysql:changer_son_mot_de_passe_mysql

Changer son mot de passe MySQL

On peut changer facilement son mot de passe depuis phpmyadmin:

en ligne de commande:

SET PASSWORD FOR monty@host = password( 'new_password' ); 
mysql -u root -p
use mysql;
update user set password=PASSWORD("NEWPASSWORD") where User='lambda';

vous avez perdu le password root et vous ne voulez pas réinstaller mysql en faisant un backup des tables? rien de plus simple

source: http://www.cyberciti.biz/tips/recover-mysql-root-password.html

Step # 1 : Stop mysql service

# /etc/init.d/mysql stop
Output:

Stopping MySQL database server: mysqld.

Step # 2: Start to MySQL server w/o password:

# mysqld_safe --skip-grant-tables &
Output:

[1] 5988
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[6025]: started

Step # 3: Connect to mysql server using mysql client:

# mysql -u root
Output:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

Step # 4: Setup new MySQL root user password

mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
  • info/mysql/changer_son_mot_de_passe_mysql.txt
  • Dernière modification : 2024/02/29 08:39
  • de radeff