Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL ERROR 1064: 'DEFAULT CHARACTER SET utf8'

Tags:

mysql

utf-8

I create a database specified its charset as utf8 by:

CREATE DATABASE IF NOT EXISTS gtfs;
    DEFAULT CHARACTER SET utf8;
    DEFAULT COLLATE utf8_general_ci;

but encounter the following error:

ERROR 1064 (42000) at line 12: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARACTER SET utf8' at line 1

The version of MySQL:

$ mysql --version
mysql  Ver 14.14 Distrib 5.6.27, for debian-linux-gnu (x86_64) using  EditLine wrapper
like image 507
SparkAndShine Avatar asked Feb 25 '16 15:02

SparkAndShine


1 Answers

Use this

CREATE DATABASE IF NOT EXISTS gtfs
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
like image 113
SkyWalker Avatar answered Oct 16 '22 18:10

SkyWalker