


Solution to Chinese garbled code in mysql5.5 database command line under Windows 10
After resetting the system, the MySQL database installed a long time ago has a problem with Chinese garbled characters in console queries. This article mainly shares with you the solution to Chinese garbled characters in the mysql5.5 database command line under Windows 10. I hope it can help everyone.
Open the my.ini file in the installation directory
Mine is: C:\Program Files\MySQL\MySQL Server 5.5, modify it as follows:
[client] default-character-set=utf8 port=3306 [mysql] #网上下面这个 gbk 很多回答也是设置为utf8,结果就是乱码 default-character-set=gbk # SERVER SECTION # ---------------------------------------------------------------------- ## The following options will be read by the MySQL Server. Make sure that # you have installed the server correctly (see above) so it reads this # file. # [mysqld]# The TCP/IP Port the MySQL Server will listen on port=3306 #Path to installation directory. All paths are usually resolved relative to this. basedir="C:/Program Files/MySQL/MySQL Server 5.5/" #Path to the database root datadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/" # The default character set that will be used when a new schema or table is # created and no character set is defined character-set-server=utf8 collation-server=utf8_general_ci 修改完毕重启mysql,查看一下编码: mysql> show variables like 'character_set%'; +--------------------------+---------------------------------------------------------+| Variable_name | Value | +--------------------------+---------------------------------------------------------+| character_set_client | gbk || character_set_connection | gbk || character_set_database | utf8 || character_set_filesystem | binary || character_set_results | gbk || character_set_server | utf8 || character_set_system | utf8 || character_sets_dir | C:\Program Files\MySQL\MySQL Server 5.5\share\charsets\ | +--------------------------+---------------------------------------------------------+ 操作试试: mysql> insert into per values('乱码解决'); Query OK, 1 row affected (0.00 sec) mysql> select * from per; +--------------+| name | +--------------+| 的纷纷从 || 乱码解决 | +--------------+ 3 rows in set (0.00 sec)
Related recommendations:
Detailed explanation of Chinese garbled code problem in mysql database
How to correct Chinese garbled code when MySQL inserts data manage?
How does php solve the problem of Chinese garbled characters?
The above is the detailed content of Solution to Chinese garbled code in mysql5.5 database command line under Windows 10. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Solutions to failed Windows 10 installation: 1. Check the hardware; 2. Update the driver; 3. Use reliable installation media; 4. Clean the existing system; 5. Check the system requirements; 6. Adjust BIOS/UEFI settings; 7. Clear Virus.

For those unfamiliar, Low Power Mode reduces your Mac's energy usage, potentially extending battery life at the expense of performance temporarily, but it's handled well enough that for most users, they won't notice to any particular degradation. This is a very useful mode if you're a Mac laptop user trying to get the most battery life possible from your MacBook Pro or Air. Enable Mac Low Power Mode from the Command Line From the Terminal, type the following command string on any Mac laptop: sudo pmset -a lowpowermode 1 Press Enter as sudo requires and enter the administrator password to authenticate.

Three commonly used methods: 1. The most convenient method is to press the Windows key and R key at the same time; 2. Access "Run" through the shortcut menu or start menu; 3. By entering specific commands, users can quickly start the program, Open files or folders, configure system settings, and more.

Obtaining a Windows 10 activation key is key to fully experiencing its capabilities. The legal way is to purchase a genuine key and then activate it through the "Activate" option in the system settings. Using illegal or pirated keys can pose security risks and is a violation of intellectual property rights. This article will guide you through legal means to obtain and activate a Windows 10 activation key, ensuring the security of your computer and supporting the work of software developers.

Many friends who use win10 system have encountered this problem when playing games or installing the system. The application cannot be started because the parallel configuration of the application is incorrect. For more information, see the application event log, or use the command line sxstrace.exe tool. This may be because the operating system does not have corresponding permissions. Let’s take a look at the specific tutorial below. Tutorial on using the command line sxstrace.exe tool 1. This problem usually occurs when installing programs and games. The prompt is: The application cannot be started because the parallel configuration of the application is incorrect. For more information, see the application event log, or use the command line sxstrace.exe tool. 2. Start →

This article details the steps to upgrade Ubuntu 20.04 to 22.04. For users using Ubuntu 20.04, they have missed the new features and advantages brought by version 22.04. In order to get a better experience and security, it is recommended to upgrade to a newer Ubuntu version in time. Ubuntu22.04 is codenamed "Jamie Jellyfish", let's explore how to get the latest LTS version! How to upgrade Ubuntu 20.04 to 22.04 via the command line Mastering the command line will give you an advantage. While it is possible to update Ubuntu via the GUI, our focus will be via the command line. First, let’s check the currently running version of Ubuntu using the following command: $

In Python, parameters can be passed to scripts via the command line. These parameters can be used inside scripts to perform different actions based on different inputs. Detailed explanation of Python command line parameters: 1. Positional parameters: parameters passed to the script in order on the command line. They can be accessed through position inside the script; 2. Command line options: parameters starting with - or -, usually Used to specify specific options or flags for the script; 3. Pass parameter values: Pass parameter values through the command line.

With the widespread application of the Linux operating system, more and more people are beginning to need to learn and understand the basic commands and shortcuts in the Linux system. In this article, we will introduce some commonly used Linux commands and shortcuts to help beginners understand the Linux system and improve work efficiency. Commonly used commands 1.1ls command The ls command is one of the most commonly used commands in Linux. It is mainly used to list files and subdirectories in the current directory. Commonly used options are: -l: Display file information in long format, including file type
