1. Remove MySQL a. sudo apt-get autoremove --purge mysql-server* b. sudo apt-get remove mysql-server c. sudo apt-get autoremove mysql-server d. sudo apt-get remove mysql-common (very important) Some of the above are actually redundant, it is recommended to execute them in order. 2. Clean up residual data dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P 3. Install mysql a. sudo apt-get install mysql-server b. sudo apt-get install mysql-client c. sudo apt-get install php5-mysql (installing php5-mysql is to connect php and mysql) After installation, the MySQL service can be started. You can also manage the MySQL service with the following command service mysql start (Start mysql) service mysql stop (Shut down mysql) service mysql restart (Restart mysql) Use the following command to enter mysql mysql -u root -p 123456 (123456 is the password you set for yourself) View Encoding show variables like '%character%'; [python] view plain copy mysql> show variables like 'character%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | latin1 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+ You will find that some encodings are latin1, which will cause garbled Chinese characters. Modify the encoding configuration as follows cd /etc/mysql/my.cnf (When modifying the code, pay attention to your own MySQL version and system, which may be different) sudo chmod 775 my.cnf sudo vim my.cnf Add the following content after the file [python] view plain copy [mysqld] character-set-server=utf8 ESC + :wq save and exit Use service mysql restart to restart the mysql service You may also be interested in:
|
<<: How to upload the jar package to nexus via the web page
>>: Vue uses Split to encapsulate the universal drag and slide partition panel component
I. Strict Mode Explanation According to the restr...
Preface This article mainly introduces a problem ...
1. Use of CSS scope (style division) In Vue, make...
01 Winter Flakes (Individual only) 02 Snowtop Cap...
Preface When I was typing my own personal blog, I...
First of all, what is 404 and soft 404? 404: Simpl...
Today, let’s discuss an interesting topic: How mu...
According to the methods of the masters, the caus...
Introduction When talking about distribution, we ...
In the past, almost every website had a sitemap p...
Preface As we all know, HTML5 belongs to the Worl...
When using VMware Workstation to open a virtual m...
There are some problems with the compressed versi...
Table of contents Angular accomplish Calling orde...
Alignment issues like type="radio" and t...