从Roller学到的mysql操作语句,记录一下方便拷贝

CREATE DATABASE roller DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER DATABASE roller DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

(注意设置utf8的编码)

mysql -u root -p
create database roller;
grant all on roller.* to scott@'%' identified by 'tiger';
grant all on roller.* to scott@'localhost' identified by 'tiger';
use roller;
source createdb.sql
quit

JDBC连接串:
mysql://localhost:3306/roller?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&mysqlEncoding=utf8
mysql://localhost:3306/roller?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&mysqlEncoding=utf8

mysql4.1.*的版本建议用Connector/J 3.0.16 (or later 3.0.X series),不建议使用3.1.*的驱动

 

文档参考
    http://rollerweblogger.org/wiki/Wiki.jsp?page=Platforms
    http://rollerweblogger.org/wiki/Wiki.jsp?page=UserGuide_2.x#ref-UserGuide_2.x-41
    http://rollerweblogger.org/wiki/Wiki.jsp?page=ConfigurationGuide
    http://rollerweblogger.org/wiki/Wiki.jsp?page=Platforms
    http://rollerweblogger.org/wiki/Wiki.jsp?page=RollerWiki

 

your MySQL server version for the right syntax to use near '?' at line 1" [#13]
This appears to be due to a MySQL and Connector/J bug that occurs if you use the MySQL 4.1.X server with Connector/J 3.1.X drivers. We recommend that you use the Connector/J 3.0.16 (or later 3.0.X series) drivers with MySQL 4.1.X to avoid this. You can download them from the MySQL site. Drop the jar in your CATALINA_HOME/common/lib and remove any 3.1.X drivers that you have there.

An alternate workaround that will allow you to keep the Connector/J 3.1.X drivers is to disable use of server-side prepared statements by setting the additional property useServerPrepStmts=false in both of the MySQL JDBC URLs in the context configuration.

Roller user Lee Gwun Wai has reported on the roller-user mailing list that this can also occur in the typical ISP-hosted situation where one's database is using UTF-8 but the overall server character set is something other than UTF-8. He suggests dropping the useUnicode=true from all JDBC URLs. There is additional information on hosted database configuration on our MySQL i18n Configuration Page. We have still only seen this reported with the Connector/J 3.1.X drivers.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值