Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
978 views
in Technique[技术] by (71.8m points)

mysql - How to set the default character-set?

I want to create a new db in mysql. I set utf8 as the default-character-set, but when I attempted to restart the db, mysql failed to restart and posted the following prompt:

Trying to start the server ... Could not re-connect to the MySQL Server. Server could not be started.

Plugin 'FEDERATED' is disabled.

C:Program FilesMySQLMySQL Server 5.5inmysqld: unknown variable 'default-character-set=utf8'

Aborting

C:Program FilesMySQLMySQL Server 5.5inmysqld: Shutdown complete

I know that after cancelling the default-character-set, mysql will restart. But if I had to set the default-character-set, is there some other way to make mysql work again?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had a similar problem. The answer, as EO2 pointed out, is that default-character-set is deprecated in 5.5. You should use instead:

character-set-server = utf8

BTW, it's better if answers are answered as answers, not comments... ;-)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...