One of the most important things you need to do when setting up your new MySQL server instance is to set the password for the root user account. By default, root has no password which is of course quite the security dilemma.
The simplest way to set the root password, or indeed any other user account password, is to make use of the bundled mysqladmin.exe application (found in the bin folder of your MySQL installation directory).
To use, simply open up your command line window and run:
mysqladmin -u root password newpassword
where newpassword is your selected password you wish to apply to the root account.
However, if you already have a password associated with the root account, you then need to add the existing password into the mix, meaning that your application call signature will now look like this:
mysqladmin -u root -poldpassword newpassword
(NOTE: this method applies to any user account, so for example to set the password for the user account craig, I would simply input -u craig instead of -u root in my argument list. Oh, and also notice the lack of a space between the -p switch and the supplied password. I have honestly no idea why this is the case, but it does seem like you need to input it in this fashion.)
You might also enjoy:
-
By default, most MySQL installations' root user account starts with a blank password, a password set to nothing. Now when installing MySQL as part of a pack ...
-
MySQL gets installed with a default root account under the username "root". Sometimes the system will allow you to install a root account without a password ...
-
To create a user account from a MySQL server instance, we need to make use of a CREATE USER call to the mysql.user table. First, fire up MySQL in your t ...
-
To delete a user account from a MySQL server instance, we need to make use of a DROP USER call to the mysql.user table. First, fire up MySQL in your ter ...
-
To get a list of user accounts on a MySQL server instance, we need to make a SELECT call to the mysql.user table. First, fire up MySQL in your terminal ...