Some of the problems you encounter with MySQL

Source: Internet
Author: User

1 mysql5.7 folder does not have My.ini files

Solutions

If it is installed under the Windows system, it should be under this directory: C:\ProgramData\MySQL\MySQL Server 5.7

But if the Programdata folder is not found in the C drive, then this folder is hidden, showing hidden files on the line.

2 and then encounter new problems, modify the time to deny access

Solutions

Modify after shutting down the server

Or create a new my.txt after copying the information, and then modify the suffix name

3 inserting Chinese characters in MySQL is garbled

Solutions

In case of garbled, you can use the statement show variables like ' character% '; To view the associated encoding set for the current database.

You can see that MySQL has six character sets used in the following: client, connection, database, results, server, System. The server-side Related: Database, server, System (can never be modified, is utf-8); related to clients: connection, client, results.

Client The character set used for the client.
Connection Sets the type for the character set of the connection database, if the program does not indicate that the character set type used by the connection database is set according to the default set of characters on the server side.
Database The character set that is used for a library in the database server, and if it is not specified when the library is built, uses the charset settings specified when the server is installed.
Results The character set that is used when the database is returned to the client and, if not specified, the default character set of the server.
Server The default character set specified when the server is installed.
System The character set used for the database system.

Understand the above information we come to analyze the reason for garbled, the problem is in the current CMD client window, because the current CMD client input using GBK encoding, and the database encoding format is UTF-8, encoding inconsistency led to garbled production. The current CMD client encoding format can not be modified, so can only modify the connection, client, results encoding set to inform the server side of the current inserted data GBK encoding, and the server's database, although the use of UTF-8 encoding, but can recognize the notification server-side GBK encodes the data and automatically converts it to UTF-8 for storage. You can use the following statement to quickly set up the encoding set associated with the client:

set names UTF8;

After the setting is complete, the client can be resolved to insert data or display data garbled problem, but we will soon find that this form of settings only in the current window is valid, when the window is closed and reopen the CMD client when the garbled problem will occur, then, how to do a once and for all settings? In the MySQL installation directory has a My.ini configuration file, by modifying this configuration file can once and for all solve garbled problem. In this configuration file [MySQL] is related to the client configuration, [mysqld] is related to the server configuration. The default configuration is as follows:

    • [MySQL]
    • Default-character-set=utf8
    • [Mysqld]
    • Character-set-server=utf8

Just change the default encoding Default-character-set=utf8 to DEFAULT-CHARACTER-SET=GBK and restart the MySQL service.

4 display When you enter MySQL at the command prompt

ERROR 1045 (28000): Access denied for user ' ODBC ' @ ' localhost ' (using Password:no)

Workaround, enter Mysql-u root-p, and then enter the password on the line.

Some of the problems you encounter with MySQL

Related Article

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.