For security reason you should change the root password of your MySQL installation immediately! Unfortunately and even it is very easy many users leave it untouched though.
There are several way to do and a lot of MySQL tools will assist nad help you with that. But to give you a helping hand with your security we will share the most two common ways to do with you here.
First there is the possibility to directly change it on your server prompt by entering a simple command forcing the MySQL engine to ask for a root password further on:
To change your the MySQL root password to PaSsWoRd, use:
mysqladmin -u root password PaSsWoRd
Another way to succeed could be changing it by SQL statement:
grant all on database.* to username@’%’ identified by “password”;
grant all on database.* to username@’localhost’ identified by “password”;
With this given example you can do both, either create a new user or change the password for an already existing user.
Please take care about to substitute the given variable within the SQL statement for database, username and password with appropriate values though. As also be aware that based on MySQL is differencing between local and remote traffic you have to do for both sources!
Already set a password and later on, you have to use the following command:
mysql -u root -p and at command login prompt password: “type in your password” to then go on executing the statements above.