Change password root in MySQL on Redhat Centos

Change password root in MySQL on Redhat Centos

 Change password root in MySQL on Redhat Centos

To install MySQL on Fedora 9 again, follow these steps:

Open the terminal on your Fedora 9 system.

Run the following command to install the MySQL server package:

sudo dnf install mysql-server



This will install the MySQL server package and its dependencies.
Once the installation is complete, you can start the MySQL service using the following command:

sudo systemctl start mysqld

This will show the status of the MySQL server. You should see the service as "active (running)".
If you want the MySQL server to start automatically on system boot, you can enable the service using the following command:

sudo systemctl enable mysqld

Check the status of the MySQL service:

sudo systemctl status mysqld
Wait a few seconds and then check the status again.

If the service is still not starting properly, try checking the MySQL log file for any error messages:

sudo cat /var/log/mysqld.log


check the password root on the log file

You should now be able to connect without a password.
In the MySQL prompt, run the following command to change the root password

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

Replace 'your_new_password' with the new password you want to set for the root user.


Flush the privileges to make the change take effect:

FLUSH PRIVILEGES;

Reactions

Post a Comment

0 Comments

close