Search for questions :
My Profile
Categories

RozyRoy

Open Question Bookmark and Share

How to assign a password to the root account on MySQL?

Hi friends, I have decided to assign a password protection in root account on MySQL. To perform this event, what steps are taken? Can you help me to state those steps? Thanks!

275 day ago

    Comment(s) (0)
    Report Abuse
   Find Intereseting  
   E-Mail to Friends  
   Bookmark  
   Subscribe to Answer Alert  
No comments yet !!!     Be the first to comment
Answers (1)

JimmyRayJit
To secure the anonymous accounts on MySQL, we use password protection. In the same way today we can set-up a password protection for root account on MySQL. To set up the password in root account of MySQL can be different as OS platform. Here I will discuss about only Windows.

To setup the password for root account, you need to perform the below given steps:

• Connect to the MySQL Server as root
• Use the “Set Password” statements

To assign the password, use PASSWORD function with following steps or commands:

shell> mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('*************');
mysql> SET PASSWORD FOR 'root'@'%' = PASSWORD('***************');

If you want to connect to the MySQL server after assign the password for root account MySQL, you will have to supply the password as:

shell> mysqladmin -u root -p shutdown
Enter password: (******************)

During these events if any negative aspects occur, you will need to go for MySQL Repair.


Posted 275 days ago

( 0 )
( 0 )
    Comment(s) (0)
   Report Abuse
No comments yet !!! Be the first to comment on this answer !!!

Email this question link to friends
You must enter email-address, if name is entered and vice-versa for each friend.
Friend #1 -
Friend #2 -
Friend #3 -
Friend #4 -
Friend #5 -
  Your comment on this question
Max Allowed : 5000 Characters Current Count : 0
  Your comment on this answer
Max Allowed : 5000 Characters Current Count : 0