mysql - Difference between database, table, column collation -



mysql - Difference between database, table, column collation -

i understand collations set of rules making comparisons on character set. mysql has table , database collations in add-on column collation. wondering difference between collation on these 3 (database, table , column).

thanks alot.

mysql's character sets , collations can interpreted top-down list of prioritized items. topmost to the lowest degree priority , bottommost priority.

order of precedence topmost beingness to the lowest degree precedence:

server collation connection-specific collation database collation table collation column collation query collation (using cast or convert)

the server collation set server, set either within of my.cnf or when server built source code. default, latin1 or utf8, depending on platform.

the connection-specific collation set client using query set names 'utf8' collate 'utf8_unicode_ci';. clients don't set connection-specific collation, server utilize own default explained above.

the database collation set during database creation, or manually updating later. if don't specify one, utilize next higher-level collation, either connection-specific or server collation.

the table collation same database collation, except if left blank, utilize database default, connection-specific, , server's collation.

the column collation uses table's collation default, , if there no collation set, follow chain find collation use, stopping @ server if of others weren't set.

the query collation specified in query using cast or convert, otherwise utilize next available collation in chain. there's no way set unless utilize function.

more info on stuff: http://dev.mysql.com/doc/refman/5.6/en/charset.html

mysql database collation

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -