Mysql存储过程名规则,更改MySQL存储过程“数据库排序规则”的名称

I have imported a DB from Local machine to server machine. While importing the Database, the character set values of the DB are set by system default to "Latin". I have changed the character set to "utf8" for the Database. But, the stored procedure of Database collation values are not modified. Currently it is "latin1_swedish_ci". How to change the Database collation values from "latin1_swedish_ci" to "utf8_general_ci" for all the stored procedures.

SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME

FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = DB_Name;

USE DB_Name;

ALTER DATABASE DB_Name

DEFAULT CHARACTER SET = utf8

DEFAULT COLLATE=utf8_general_ci;

SET NAMES UTF8;

Thanks in advance.

解决方案If CHARACTER SET and COLLATE attributes are not present, the database character set and collation in effect at routine creation time are used. To avoid having the server use the database character set and collation, provide explicit CHARACTER SET and COLLATE attributes for character data parameters.

If you change the database default character set or collation, stored routines that use the database defaults must be dropped and recreated so that they use the new defaults.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值