MySQL database has a database named MySQL;
Yes, it's a bit of a detour, and it's understandable to read it more than two times.
The execution show tables;
can be found to have so 28 tables under it;
Mysql> use mysql; database changedmysql> show tables ; +---------------------------+ | tables_in_mysql | +------------------ ---------+ | columns_priv | | db | | event | | func | | general_log | | help_category | | help_keyword | | help_relation | | help_topic | | innodb _index_stats | | innodb_table_stats | | ndb_binlog_index | | plugin | | proc | | procs_priv | | proxies_priv | | servers | | slave_master_info | | slave_relay_log_info | | slave_worker_info | | slow_log | | tables_priv | | time_zone | | time_zone_leap_ second | | time_zone_name | | time_zone_transition | | time_zone_transition_type | | user | +---------------------------+ 28 rows in&nBsp;set
You can skip the previous 27 sheets and see the last one directly;
The user table records the data of users who log in to MySQL;
We change the user's login password is actually to change the data in the Users table;
The following example is to change the root password to Baijunyaoboke;
mysql> use MySQL; Database changedmysql> Update user Set password = password ("Baijunyaoboke") Where user = "root"; Query OK, 3 rows affected rows Matched:3 changed:3 warnings:0 Query OK, 3 rows affectedmysql> flush Privileg Es Query OK, 0 rows affected
After the change, remember to flush privileges;
refresh the system permissions related tables;
Finally, one thing is emphasized with the history of blood and tears. Do not use this method to modify the password in the Wampserver environment;
Otherwise, in addition to reloading Wampserver, temporarily did not find a solution to change the password error after the problem;
650) this.width=650, "alt=" Bai Jun Remote Blog "src=" http://www.baijunyao.com/Upload/image/ueditor/20151116/1447688767570598. JPEG "title=" Bai Jun Haruka Blog "/>
Modify the MySQL password