天天看点

MySQL集锦

  • 登录命令:

    mysql -u root -padmin;

  • 查看系统变量:

    show variables like '%dir%';

  • java异常:

    No suitable driver found for jdbc:mysql://localhost:3306/test?characterEncoding=UTF-8

    检查项目运行时需要的库中是否包含了mysql的jdbc驱动jar包

    InvalidConnectionAttributeException: The server time zone value

    在配置jdbc的url时,添加时区参数:jdbc:mysql://localhost:3306/how2java?characterEncoding=UTF-8&serverTimezone=UTC