A database basic configuration includes the Encoding method ( installation environment is under linux )
1.1 Entering the database
Open Database services: Servicemysqld Start/restart ( can be restarted if the session is turned on )
Shutdown Database Services : Service mysqld stops
Mysql–u root–h127.0.0.1–p
Then enter the password to enter the database
1.2 Viewing MySQL encoding method information
Show variables likes '%character% ';
The coding methods for discovering database clients, services, and connections are all latinl need to be modified to UTF8
1.3 Recommended ways to modify a configuration file
Locate the my.cnf file under /etc/ If you cannot find the installation file location to copy my.cnf to / etc the next.
1.4 Opening my.cnf Modifying the encoding method
add default-character-set=utf8 under [client]
add default-character-set=uft8 and Character-set-server=utf8 under [mysqld]
init_connect= ' SET NAMES UTF8 ' ( initializes the database connection mode encoding.
1.5 Restarting the server
Service mysqld Restart
1.6 Enter the database to view the encoding method
Now modify the character set encoding has been done can be tested to see if the Chinese will also appear garbled
Two-case sensitive modification
- For large message sensitivity only need to modify the my.cn file in [mysqld] to join:
Lower_case_table_names=1 ( case Sensitive )
Lower_case_table_names=0 ( case insensitive )
MySQL Database basic configuration