Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deal with mysql garbled under linux

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces how to deal with mysql garbled under linux, the things involved, learned from the theoretical knowledge, there are many books, literature for your reference, from a practical point of view, accumulated years of practical experience can be shared with you.

Solution:

1. Enter msyql first, and then use show variables like 'character%' to perform the encoding display. You can see the following figure:

By default, both the client and the CVM use latin1, so the code will be garbled.

2. Modify / opt/lampp/etc/my.cof file

Add the above statements under mysql,mysqld,client respectively.

Note: if you can't start the error report after modification, try changing default-character-set=utf8 to character_set_server=utf8;. I have encountered this problem here, so it will be normal after removing default, and default-character-set=utf8 is not used in the script.

3. Delete the created database by using the command drop database database name

4. Restart the service of mysql:

/ opt/lampp/lampp restart

5. Recreate the database and table structure, insert the data again and use it normally.

These are the details of the mysql garbled problem under linux. Please pay more attention to other related articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report