MySQL re-set password, mysql set encode UTF8 mysql reset password, mysql settings storage encoding format

Source: Internet
Author: User
Tags mysql view

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.