root MySQL?

Keep calm and reset your password

3

, root MySQL, . , . , MySQL, .

, , root MySQL 8.0.

MySQL, MySQL .

   root   MySQL

MySQL root init-file

root - , MySQL, --init-file, :

# vim /home/user/init-file.txt

, mysql. new_password , :

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

, MySQL . :

# systemctl stop mysqld.service     #    systemd 
# /etc/init.d/mysqld stop           #    init

:

# mysqld --user=mysql --init-file=/home/user/init-file.txt --console

MySQL , , , root . .

.

# systemctl stop mysqld.service        #    system
# systemctl restart mysqld.service     #    systemd
# /etc/init.d/mysqld stop              #    init 
# /etc/init.d/mysqld restart          #    init

MySQL root, .

# mysql -u root -p

MySQL root skip-grant-tables

- MySQL --skip-grant-tables. , , .

--skip-grant-tables, --skip-network , .

, MySQL .

# systemctl stop mysqld.service     #    systemd 
# /etc/init.d/mysqld stop           #    init

.

# mysqld --skip-grant-tables --user=mysql &

MySQL, :

# mysql

--skip-grant-tables, . , :

# FLUSH PRIVILEGES;

, . new_password , .

# ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_passowrd';

MySQL .

# systemctl stop mysqld.service        #    system
# systemctl restart mysqld.service     #    systemd
# /etc/init.d/mysqld stop              #    init 
# /etc/init.d/mysqld restart          #    init

:

# mysql -u root p

50% Merion Academy