mysqlcollationcase-sensitive

MySQL case sensitivity for primary key


Are MySQL primary key values case sensitive? If it's an option how do I set it? I want the table to be able to store "www.Example.com" and "www.example.com" as different values.


Solution

  • You can set per-column collations in MySQL: https://dev.mysql.com/doc/refman/5.5/en/charset-column.html

    e.g. if your table is generally (say) case insensitive, you can override it per-field to be case-sensitive.