MySQL Database basic configuration

Source: Internet
Author: User

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

    1. 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

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.