2017-06-08

MySQL - How to change root user's password

(1) Create a custom initialization file containing this (e.g. named custom-init.txt):
ALTER USER 'root'@'localhost' IDENTIFIED BY 'YOUR_NEW_PASSWORD';
 
(2) Start MySQL using this command: 
mysqld --init-file=C:\\mysql\custom-init.txt
 
 
PS. Variants of the alter user statement may be necessary for MySQL versions earlier than 5.7
 
 

No comments:

Post a Comment