Anecdotes from a Linux Systems Administrator. /root

Home About Books Blog Portfolio Archive
19 December 2011

Resetting MySQL root password

by Alpha01

1). End current mysql process

2). Run MySQL safe daemon with skipping grant tables

mysqld_safe --skip-grant-tables &

3). Login to MySQL as root with no password:

mysql -u root mysql

4). Run UPDATE query to reset the root password. In MySQL command line prompt issue the following two commands:

UPDATE user SET password=PASSWORD("NEWPASSWD") WHERE user="root";
Tags: [ mysql ]