There is a link on how to re-set password.
Http://database.51cto.com/art/201010/229528.htm
Words in short,
Lines
mysql> UPDATE mysql.user SET password=password (' Your_new_password ') WHERE user= ' root '; MySQL> FLUSH privileges;
And about MySQL encoding:
Here is a helpful link:http://www.linuxidc.com/linux/2013-11/93011.htm
___
First of all this is my first Ubuntu under MySQL default character set (), in Java input Chinese to the database is all garbled question mark, MySQL is not recognized, because the MySQL default character set is Latin1 (Iso_8859_1) is not a UTF8 character set.
Modification Method:
1. Open the My.cnf file for modification (note here that the MySQL version is more than 5.5, the following version should also be generic, specifically not tested, but more than 5.5 of the absolutely feasible)
sudo gedit/etc/mysql/my.cnf
2. Add the following code under [Mysqld] (for 5.5 or later, [mysqld] 's default character set setting is already an abandoned parameter, you can use these to see the corresponding version of the manual)
Character-set-server=utf8
Collation-server=utf8_general_ci
Skip-character-set-client-handshake
3. Quit restarting the MySQL service
sudo service MySQL restart
4. Go to MySQL view character set
Mysql> Show variables like ' collation_% ';
Mysql> Show variables like ' character_set_% ';
____thanks for his sharing!