Modify User namemysql> use MySQL; Select Database
Database changed
mysql> Update user set user= "DNS" where user= "root"; Change the user name root to DNS
Change Password
Method One
Using phpMyAdmin, this is the simplest, modify the MySQL library's user table,
But don't forget to use the password function.
Method Two
Using Mysqladmin, this is a special case of the preceding declaration.
Mysqladmin-u root-p Password mypasswd
After entering this command, you need to enter the root's original password, then the root password will be changed to MYPASSWD.
Change the root of the command to your username, and you can change your own password.
Of course if your mysqladmin is not connected to MySQL server, or you have no way to execute mysqladmin,
Then this method is ineffective.
And mysqladmin can't erase the password.
The following methods are used at the MySQL prompt and must have root privileges for MySQL:
Method Three
Mysql> INSERT into Mysql.user (Host,user,password)
VALUES (%,jeffrey,password (iscuit));
Mysql> FLUSH Privileges
Specifically, this is the addition of a user named Jeffrey, with a password of biscuit.
There is this example in the MySQL Chinese reference manual, so I wrote it out.
Note that you want to use the password function, and then you also use the flush privileges.
Method Four
As with method Three, just use the Replace statement
Mysql> REPLACE into Mysql.user (Host,user,password)
VALUES (%,jeffrey,password (iscuit));
Mysql> FLUSH Privileges
method Five I think this use is relatively simple
Using the Set Password statement,
mysql> SET PASSWORD for [email protected] "%" = PASSWORD (Iscuit);
You must also use the password () function,
However, you do not need to use flush privileges.
Method Six
Use Grant ... Identified by statement
Mysql> GRANT USAGE On * * to [email protected] '% ' identified by Iscuit;
Here the password () function is unnecessary and does not require the use of flush privileges.
Note: PASSWORD () [NOT] Execute password encryption in the same way that the UNIX password is encrypted.
Modify Port:
Locate the My.ini configuration file in the MySQL installation directory
Find port=3306 to change the 3306 port to the port number you want to change, and restart the MySQL service to take effect.
MySQL Modify user name and password