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
Although you think it may be a browser problem, i...
This article uses examples to illustrate the basi...
After a lot of trouble, I finally figured out the...
For reference only for Python developers using Ub...
nohup Command When using Unix/Linux, we usually w...
Table of contents 1. Swap partition SWAP 1.1 Crea...
1. Install the Linux system on the virtual machin...
After installing Docker on the Linux server, Pull...
Recently the company has arranged to do some CCFA...
1. Python automatically runs at startup Suppose t...
The error "mysql is not an internal command&...
Preface This article records how I use docker-com...
Table of contents 1. New usage of watch 1.1. Watc...
Preface What is the role of an agent? - Multiple ...
This article shares the specific code of Vue usin...