1 安装这篇文章配置的:

http://blog.csdn.net/carolzhang8406/article/details/7766281

然后直接运行一直报错:

at groo2012-07-27 10:39:05,656 [main] ERROR context.GrailsContextLoader

- Error executing bootstraps: Error creating bean with name 'messageSource': In

itialization of bean failed; nested exception is org.springframework.beans.facto

ry.BeanCreationException: Error creating bean with name 'transactionManager': Ca

nnot resolve reference to bean 'sessionFactory' while setting bean property 'ses

sionFactory'; nested exception is org.springframework.beans.factory.BeanCreation

Exception: Error creating bean with name 'sessionFactory': Cannot resolve refere

nce to bean 'lobHandlerDetector' while setting bean property 'lobHandler'; neste

d exception is org.springframework.beans.factory.BeanCreationException: Error cr

eating bean with name 'lobHandlerDetector': Invocation of init method failed; ne

sted exception is org.springframework.jdbc.support.MetaDataAccessException: Erro

r while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp

.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'

org.springframework.beans.factory.BeanCreationException: Error creating bean wit

h name 'messageSource': Initialization of bean failed; nested exception is org.s

pringframework.beans.factory.BeanCreationException: Error creating bean with nam

e 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while

setting bean property 'sessionFactory'; nested exception is org.springframework.

beans.factory.BeanCreationException: Error creating bean with name 'sessionFacto

ry': Cannot resolve reference to bean 'lobHandlerDetector' while setting bean pr

operty 'lobHandler'; nested exception is org.springframework.beans.factory.BeanC

reationException: Error creating bean with name 'lobHandlerDetector': Invocation

of init method failed; nested exception is org.springframework.jdbc.support.Met

can not load com.mysql.jdbc.Driver

.............................

..........................

然后google ,baidu  试了很多方法,都不对,人都快崩溃了,无意中看到下面这篇文章,找到问题所在,原来我所参考的文章并不对,下载这个zip包之后需要解压,把mysql-connector-java-5.1.21-bin.jar 这个拷贝到lib下面。

2.将MySql的Jar包放到项目的lib文件夹下

http://www.grsage.com/new/GrailsMysql.html

然后重新运行,搞定 。

dataSource {

pooled = true

driverClassName = "com.mysql.jdbc.Driver"

username = "root"

password = "root"

dialect = org.hibernate.dialect.MySQL5InnoDBDialect

}

hibernate {

cache.use_second_level_cache = true

cache.use_query_cache = true

cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'

}

// environment specific settings

environments {

development {

dataSource {

dbCreate = "create" // one of 'create', 'create-drop','update'

url = "jdbc:mysql://127.0.0.1/grails?useUnicode=true&characterEncoding=UTF-8"  //你所创建的DB的名称,至于前面写localhost 和127那种都行,如果不在一个机器上,替换为对应的机器名。         }         hibernate {             show_sql = true         }     }     test {         dataSource {             dbCreate = "create-drop" // one of 'create', 'create-drop','update'              url = "jdbc:mysql://127.0.0.1/grails?useUnicode=true&characterEncoding=UTF-8"         }     }     production {         dataSource {             dbCreate = "update"              url = "jdbc:mysql://127.0.0.1/grails?useUnicode=true&characterEncoding=UTF-8"         }     } }

grails链接mysql_grails 连接Mysql相关推荐

  1. grails mysql_grails连接mysql

    Grails切换到 mysql 数据库需要做如下的配置: 1.将my sql-connector-java-5.1.22-bin.jar驱动复制到Grails应用的根目录lib下面. 2.修改conf ...

  2. tableau ODBC驱动下载方法和链接(连接mysql的驱动)

    ODBC驱动链接:https://downloads.mysql.com/archives/c-odbc/

  3. ubantu mysql允许外部链接_ubuntu 下mysql 设置允许远程连接

    ubuntu: 安装mysql-server,sudo apt-get install mysql-server mysql 安装成功后查看mysql状态:/etc/init.d/mysql stat ...

  4. mac mysql 链接_mac上搭建mysql环境配置和Navicat连接mysql

    mac上搭建mysql环境配置 注意:mysql版本要和你的MAC版本保持一致 2.一路傻瓜式点击下一步 此处选择"Use Legacy Password Encryption", ...

  5. php链接数据库2000,在Win2000下用PHP和JSP连接MySQL

    一.前言 在阅读本文档之前,你的Win2000下应该已经安装好了Apache.JDK.Tomcat.PHP.MySQL.如果你还没有成功地安装好这些软件,你可以参阅Apache1.3.20在Windo ...

  6. python链接mysql 判断是否成功_【初学python】使用python连接mysql数据查询结果并显示...

    因为测试工作经常需要与后台数据库进行数据比较和统计,所以采用python编写连接数据库脚本方便测试,提高工作效率,脚本如下(python连接mysql需要引入第三方库MySQLdb,百度下载安装) # ...

  7. python链接mysql 判断是否成功_python连接mysql数据库并读取数据的实现

    1.安装pymysql包 pip install pymysql 注: MySQLdb只支持python2,pymysql支持python3 2.连接数据 import pymysql import ...

  8. php链接mysql验证用户登录,PHP连接mysql验证用户名是否存在

    登录界面 用户名: if (isset($_POST['submit'])) { $us = $_POST["user_name"]; $conn = mysqli_connect ...

  9. mysql链接出错_请配置/amysql/config.php文件_MySQL数据库之PHP连接mysql时mysql_connect()函数不可用...

    本文主要向大家介绍了MySQL数据库之PHP连接mysql时mysql_connect()函数不可用 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助. 我在搭建环境时也没有再安装m ...

最新文章

  1. vue开发页面自适应_vue-cli 【flexible】屏幕字体自适应布局及配置
  2. Fibonacci数列 递归 杨辉三角 动态规划
  3. VL09 不能取消来自分散系统的货物移动
  4. 使用Qt创建XML文档及XML文档的增删改
  5. html 常用的标签
  6. python history函数_python的history_n 和history函数 获取的成交量和持仓量出现翻倍
  7. rsync android app,如何rsync到android
  8. truncate python是删除文件内容吗_Python 文件 truncate() 方法
  9. 与MQ通讯的完整JAVA程序
  10. HDU1286 找新朋友【欧拉函数】
  11. [BZOJ4872][六省联考2017]分手是祝愿(期望DP)
  12. 美团O2O供应链系统架构设计解析
  13. Final Cut Pro X无法导入自家的MOV格式,解决方法。
  14. 中国科学院微生物研究所微生物资源与大数据中心招聘启事
  15. java接入短信容联云通讯
  16. FreeSWITCH对接MRCP Server
  17. NGINX源码之:ngx_bufchain
  18. 计算机怎么查找表格里内容,请教如何迅速查找复杂EXCEL表格里的内容? -电脑资料...
  19. MIPS递归:斐波那契数列
  20. GPA——平均绩点计算器(5.0分制)

热门文章

  1. maven多仓库配置——公司仓库和阿里仓库
  2. Win10安装Ubuntu子系统及图形化界面详细教程20210401
  3. java与线程相关的一些重要方法1(不涉及并发包)-Object的wait(long timeout)和wait()
  4. zillow房价预测比赛_Zillow预测: 未来一年美国房价将大幅上涨!
  5. 利用LBP算子结合SVM提取建筑物(一)
  6. 【翻译篇】❀ 01. 概述 ❀ 透明模式 ❀ FortiOS 手册 6.0.6
  7. 计算机二级c语言正确的做题顺序,雅思阅读:成绩提高的实践经验总结
  8. 邀约 T-MAX“科创太仓”国际创新创业大赛启动
  9. 1) 数字信号及其基本运算
  10. 作为程序员,有没有让你感到既无语又崩溃的程序命名?