Mysql Remark

1. jdbc url

 

jdbc:mysql://IP:3306/dbName?useUnicode=true&characterEncoding=GBK

 

2. user privileges 更改用户权限后记得

flush privileges;

 

 

3. 导入数据表 大小写 在 my.ini 中添加 如下配置

# Identifier Case Sensitivity 
# http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html lower_case_table_names=2

 

 

4. deal with field value is NULL

如果expr1不是NULL, IFNULL()返回expr1, 否则它返回expr2. IFNULL()返回一个数字或字符串值, 取决于它被使用的上下文环境.

IFNULL(expr1,expr2) 

 

 

 5. mysql  System DSN ODBC

http://www.mysql.com/products/connector/

 

 

 6. MySQL Syntax to get the identity (object_id) of inserted row After insert

 

SELECT LAST_INSERT_ID();

 

 

 

 7. Generate Remote User

GRANT ALL PRIVILEGES ON *.* TO ‘username’@‘host’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;

 

 8. phpMyadmin更改mysql權限密碼後無法登入 

SET PASSWORD FOR 'root'@'localhost' = OLD_PASSWORD('password');


你可能感兴趣的:(MySQL,JDBC,HTML,Mysql)