Query-Related Issues •Set the  MYSQL_UNIX_PORT  environment variable to the path of the Unix socket file. •Recompile MySQL from source to use a different default Unix socket file location. Define the path to the file with the  MYSQL_UNIX_ADDR  option when you run  CMake . See Section 2.9.7, “MySQL Source- Configuration Options” . You can test whether the new socket location works by attempting to connect to the server with this command: If you have a problem with  SELECT NOW()  returning values in UTC and not your local time, you have to tell the server your current time zone. The same applies if  UNIX_TIMESTAMP()  returns the wrong value. This should be done for the environment in which the server runs (for example, in  mysqld_safe  or mysql.server ). See Section 4.9, “Environment Variables” . You can set the time zone for the server with the  --timezone= timezone_name  option to mysqld_safe . You can also set it by setting the  TZ  environment variable before you start  mysqld . The permissible values for  --timezone  or  TZ  are system dependent. Consult your operating system documentation to see what values are acceptable. For nonbinary strings ( CHAR ,  VARCHAR ,  TEXT ), string searches use the collation of the comparison operands. For binary strings ( BINARY ,  VARBINARY ,  BLOB ), comparisons use the numeric values of the bytes in the operands; this means that for alphabetic characters, comparisons are case-sensitive. A comparison between a nonbinary string and binary string is treated as a comparison of binary strings. Simple comparison operations ( >=, >, =, <, <= , sorting, and grouping) are based on each character’s “sort value.”  Characters with the same sort value are treated as the same character. For example, if  e  and Ø  have the same sort value in a given collation, they compare as equal. The default character set and collation are  utf8mb4  and  utf8mb4_0900_ai_ci , so nonbinary string comparisons are case-insensitive by default. This means that if you search with  col_name  LIKE ’a%’ , you get all column values that start with  A  or  a . To make this search case-sensitive, make sure that one of the operands has a case-sensitive or binary collation. For example, if you are comparing a column and a string that both have the  utf8mb4  character set, you can use the  COLLATE  operator to cause either operand to have the  utf8mb4_0900_as_cs  or  utf8mb4_bin  collation: If you want a column always to be treated in case-sensitive fashion, declare it with a case-sensitive or binary collation. See Section 13.1.20, “CREATE TABLE Statement” . To cause a case-sensitive comparison of nonbinary strings to be case-insensitive, use  COLLATE  to name a case-insensitive collation. The strings in the following example normally are case-sensitive, but  COLLATE changes the comparison to be case-insensitive: mysql>  SET NAMES ’utf8mb4’; col_name  COLLATE utf8mb4_0900_as_cs LIKE ’a%’ col_name  LIKE ’a%’ COLLATE utf8mb4_0900_as_cs col_name  COLLATE utf8mb4_bin LIKE ’a%’ col_name  LIKE ’a%’ COLLATE utf8mb4_bin shell>  mysqladmin --socket=/path/to/socket version B.3.3.7 Time Zone Problems B.3.4 Query-Related Issues B.3.4.1 Case Sensitivity in String Searches 5306