Modify the root password of mysql and assign permissions. for example, if my Mysql is installed in the E: \ xampp \ mysql directory win7 and CMD is used, the command line uses the password-free root user to log on to the mysql database. The red font is command 1 ). UPDATE root user password to root2.) Refresh permission 3 ). allocate the root user to access the mysql database on any host. 4 ). refresh permission E: \ xampp \ mysql \ bin> mysql-uroot-pEnter password: Welcome to the MySQL monitor. commands end with; or \ g. your MySQL connection id is 41 Server version: 5.5.25a MySQL Community Server (GPL) Copyright (c) 2000,201 1, Oracle and/or its affiliates. all rights reserved. oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. other names may be trademarks of their respectiveowners. type 'help; 'or' \ H' for help. type '\ C' to clear the current input statement. mysql> update mysql. user set password = PASSWORD ('root') where user = 'root'; Query OK, 2 rows affected (0.00 sec) Rows matched: 2 Changed: 2 Warnings: 0 mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> grant all privileges on *. * to 'root' @ '%' identified by 'root' with grant option; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> \ qBye 2. use the modified root user password to log on to Mysql E: \ xampp \ mysql \ bin> mysql-uroot-pEnter password: ***** Welcome to the MySQL monitor. commands end with; or \ g. your MySQL connection id is 42 Server version: 5.5.25a MySQL Community Server (GPL) Copyright (c) 2000,201 1, Oracle and/or its affiliates. all rights reserved. oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. other names may be trademarks of their respectiveowners. type 'help; 'or' \ H' for help. type '\ C' to clear the current input statement. mysql> show databases; + rows + | Database | + ------------------ + | information_schema | cdcol | mysql | oms | performance_schema | phpmyadmin | test | webauth | + ------------------ + 8 rows in set (0.00 sec) mysql>