Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the default character-set?

Tags:

mysql

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 Files\MySQL\MySQL Server 5.5\bin\mysqld: unknown variable 'default-character-set=utf8'

Aborting

C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld: 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?

like image 671
kaiwii ho Avatar asked Oct 11 '11 02:10

kaiwii ho


1 Answers

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... ;-)

like image 171
robguinness Avatar answered Sep 21 '22 11:09

robguinness