Overview:
This article no longer to the MySQL grammar explanation and explanation, want to understand or familiar with the friend please own Baidu or Google learning. This article is mainly aimed at MySQL in addition to the grammar of the summary, I hope to be able to also help you.
1.centos6.x under MySQL forget root password solution
Ⅰ. To modify MySQL login settings
# VIM/ETC/MY.CNF
In the [MYSQLD] paragraph, add a sentence: Skip-grant-tables
Ⅱ. Restart Service
# Service Mysqld Restart
Ⅲ. login MySQL, modify password information
# MySQL
mysql> use MySQL;
mysql> UPDATE user SET Password=password (' New-password ') WHERE user= ' root ';
mysql> flush Privileges;
Mysql> quit
Ⅳ. Restore MySQL Login settings
# VIM/ETC/MY.CNF
Add a skip-grant-tables annotation or delete in a section of [mysqld]
Ⅴ. Restart Service
# Service Mysqld Restart
2.centos6.x Modify MySQL default encoding
Ⅰ. login MySQL View encoding format
Show variables like ' character% ';
Ⅱ. copy my-large.cnf file to/etc/my.cnf
Cp/usr/share/doc/mysql-server-4.1.12/my-large.cnf/etc/my.cnf
Ⅲ. Edit my.cnf file modify default encoding format
Vim/etc/my.cnf
Add Default-character-set=utf8 in the [mysqld] section
Add Default-character-set=utf8 in the [client] segment
Ⅳ. # service mysqld Restart # Restart Services
Ⅴ. Verify if the modification succeeds: show variables like ' character% ';
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.