MySQL sửa lỗi font tiếng Việt khi export file CSV

Khi xuất file cở sở dữ liệu database MySQL từ công cụ PHPMyAdmin xuất ra file CSV thường hay bị lỗi font tiếng Việt mặc dù bạn đã chọn định dạng xuất file là utf-8.

MySQL sửa lỗi font tiếng Việt khi export file CSV

PANPIC hướng dẫn một số thủ thuật sửa file CSV bị lỗi font tiếng Việt theo các bước như sau:

1. Xuất file CSV - Export MySQL CSV

Bạn đăng nhập vào hosting đi tới phần quản lý cở sở dữ liệu database MySQL thông thường các hosting ở Việt Nam sử dụng PHPMyAdmin

  • Chọn Export (xuất file)
  • Export method / chọn "Custom - display all possible options"
  • Format / Chọn CSV
phpmyadmin mysql xuất file csv
MySQL xuất file CSV - ảnh Panpic

Bạn kéo thanh cuộn trình duyệt xuống dưới:

  • Save output to a file / Character set of the file chọn "utf-8"
  • Format-specific options / Đánh dấu vào checkbox chọn "Put columns name in the first row"
mysql xuất dữ liệu file csv
PHPMyAdmin xuất file CSV - ảnh Panpic

Sau đó nhấp chuột vào nút "Go" để xuất file CSV / Bạn đặt tên file và lưu vào ổ địa D của máy tính.
Ví dụ: db-sua-loi-font-file.csv

Sửa lỗi font tiếng Việt file CSV

Nhấp chuột phải vào file bạn vừa xuất db-sua-loi-font-file.csv / Chọn "Edit with Notedpad++ hoặc chọn Open with / chọn More app / Tìm chương trình Notepadd++ bạn đã cài đặt ở ổ đĩa C của Windows:

C:\Program Files \ Notepad++ \ notedpad++.exe
hoặc
C:\Program Files (x86) \ Notepad++ \ notepad++.exe
Nếu bạn chưa cài Notedpad++ bạn có thể download Notepad++ hoàn toàn miễn phí từ link: https://notepad-plus-plus.org/

mysql sửa lỗi font file csv
Mở file CSV với Notedpad++ ảnh Panpic

Sau khi đã mở file CSV với Notepad++ / trên menu Notepad++ bạn vào Encoding / UTF-8-BOM / Sau đó lưu lại

mysql sửa lỗi font file csv bằng notedpad plus
Sửa lỗi font tiếng Việt file CSV - ảnh Panpic

Lúc này bạn mở file CSV bằng Excel là có thể thấy font Tiếng Việt hiển thị không còn bị lỗi

Chúc các bạn thành công
Thiết kế web Panpic

Tin liên quan

Tin liên quan