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 modify the MySQL DB character set

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to modify the MySQL DB character set, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

1 > the structure of long Yuan DB (test1) leads to

C:\ Users\ Oraman > mysqldump-uroot-p-d test1 > createdb.sql

Enter password: *

-d only table structure

Note: if there are stored procedures and functions (routines) or JOB (events) in DB, you need to specify-R-E

-R boot time includes memory process-E boot time includes events

2 > export the original DB character set

C:\ Users\ Oraman > mysqldump-uroot-p-- quick-- no-create-info-- extended-insert-- default-character-set=utf8 test1 > data.sql

Enter password: *

-Q,-- quick Don't buffer query, dump directly to stdout.

(Defaults to on; use-skip-quick to disable.)

-- no-create-info does not guide create table

-e-- extended-insert

Use multiple-row INSERT syntax that include several

VALUES lists.

-- default-character-set character set, derived from the original db character set

3 > modify the character set defined by the createdb.sql table to a new character set

4 > modify the new set names character set in data.sql

5 > build DB with the new character set (drop database,create database after the formal environment test is done)

Mysql > CREATE DATABASE test1 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci

6 > enter the structure of the table

Mysql-uroot-p test1

< createdb.sql 7>

Input data

Mysql-uroot-p test1 < data.sql

Thank you for reading this article carefully. I hope the article "how to modify the MySQL DB character set" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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

Database

Wechat

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

12
Report