mysql - erros

errors

  • 安装mysql启动服务时候报错
  • IDEA通过JDBC连接mysql写入数据中午乱码

安装mysql启动服务时候报错

/etc/init.d/mysqld start
Starting MySQL... ERROR! The server quit without updating PID file (/home/mysql/data/slave107.pid).

解决:添加软连接

mv /etc/my.cnf /etc/my.cnf.bak
ln -s /usr/local/mysql  /etc/my.cnf   //mysql安装位置:/usr/local/mysql

IDEA通过JDBC连接mysql写入数据中午乱码

解决

//DriverManager.getConnection("jdbc:mysql://172.16.2.107:3306/ApacheCommon?useUnicode=true&characterEncoding=utf8&&useSSL=false", "root", "1234")
DriverManager.getConnection("jdbc:mysql://172.16.2.107:3306/ApacheCommon?useUnicode=true&characterEncoding=utf8", "root", "1234")

你可能感兴趣的:(数据库)