ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
#service mysqld stop // id doesn't stop run #mysqladmin -u root -p shutdown
#mysqld_safe --skip-grant-tables &
#mysql -u root
> use mysql;
> update user set password=PASSWORD("mynewpassword") where User='root';
> flush privileges;
> quit
#service mysqld stop
#service mysqld start &
if mysqld_safe not exist (updated 2019)
# systemctl stop mysqld
# systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
# systemctl start mysqld
$ mysql -u root
get temporaly password (updated 2019)
$sudo grep 'temporary password' /var/log/mysqld.log
A temporary password is generated for root@localhost: cvcvcv
$mysql -u root -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
https://dev.mysql.com/doc/refman/8.0/en/linux-installation-yum-repo.htmlreference:
http://www.rackspace.com/knowledge_center/article/mysql-resetting-a-lost-mysql-root-password
No comments:
Post a Comment