Database 如何将Liferay与Mysql数据库连接

Database 如何将Liferay与Mysql数据库连接,database,liferay,Database,Liferay,我是新来的,雷。我想连接Liferay和MySQL数据库。我使用的是Liferay CE(与tomcat(6.0.29)捆绑的版本?)。请告诉我这个步骤。谢谢在portal-ext.properties中粘贴以下代码行: jdbc.default.driverClassName=com.mysql.jdbc.Driver jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UT

我是新来的,雷。我想连接Liferay和MySQL数据库。我使用的是Liferay CE(与tomcat(6.0.29)捆绑的版本?)。请告诉我这个步骤。谢谢

在portal-ext.properties中粘贴以下代码行:

jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=
jdbc.default.password=

要在前面提到的基础上进行构建,请编辑liferay portal xxx/tomcat xxx/webapps/ROOT/WEB-INF/classes中的文件portal-ext.properties(如果该文件尚不存在,则创建它)

添加以下行:

jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=<insert your mysql username>
jdbc.default.password=<insert your mysql password>
jdbc.default.drivercassname=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=
jdbc.default.password=
在mysql中创建lportal表也可能是值得的

mysql -u root -p <<< "create database lportal character set utf8;"
mysql-u root-p
  • 下载Liferay CE
  • 安装MySQL并创建数据库
  • 如果不存在portal.properties,请解压缩liferay并创建文件到liferay_home/tomcat-6.0.29/webapps/ROOT/WEB-INF/clases中
  • 粘贴以下内容:
  • jdbc.default.driverClassName=com.mysql.jdbc.Driver

    jdbc.default.url=jdbc:mysql://localhost/nameDatabase?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false

    jdbc.default.username=name

    jdbc.default.password=密码

    运行onm Eclipse或Windows.bat/Linux.sh 我希望适用于您

    1)路径--->home/karthik/Desktop/LiferaySetup/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes--->创建一个名为portal-ext.properties的空文档
    
        1)path--->home/karthik/Desktop/LiferaySetup/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes---->create an empty doc with name as portal-ext.properties
        paste the below code:
        jdbc.default.driverClassName=com.mysql.jdbc.Driver
        jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
        jdbc.default.username=root
        jdbc.default.password=root
        2)path--->/home/karthik/Desktop/LiferaySetup/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/conf/Catalina/localhost-->Enter the below code inside ROOT.xml
         <Context path="" crossContext="true">
    
            <!-- JAAS -->
    
            <!--<Realm
                className="org.apache.catalina.realm.JAASRealm"
                appName="PortalRealm"
                userClassNames="com.liferay.portal.kernel.security.jaas.PortalPrincipal"
                roleClassNames="com.liferay.portal.kernel.security.jaas.PortalRole"
            />-->
    
            <!--
            Uncomment the following to disable persistent sessions across reboots.
            -->
    
            <!--<Manager pathname="" />-->
    
            <!--
            Uncomment the following to not use sessions. See the property
            "session.disabled" in portal.properties.
            -->
    
            <!--<Manager className="com.liferay.support.tomcat.session.SessionLessManagerBase" />-->
        <Resource
            name="jdbc/LiferayPool"
            auth="Container"
            type="javax.sql.DataSource"
            driverClassName="com.mysql.jdbc.Driver"
            url="jdbc:mysql://localhost/lportal?useUnicode=true&amp;characterEncoding=UTF-8"
            username="root"
            password="root"
            maxActive="20"
        />
    
        </Context>
    If you follow the above 2 statements you can create easily
    
    粘贴以下代码: jdbc.default.driverClassName=com.mysql.jdbc.Driver jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false jdbc.default.username=root jdbc.default.password=root 2) path-->/home/karthik/Desktop/LiferaySetup/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/conf/Catalina/localhost-->在ROOT.xml中输入以下代码 如果您遵循以上两条语句,您可以轻松创建
    此外,出于兴趣的考虑,名称是“Liferay”(所有一个单词,只有L大写),而不是life ray;)更正了问题中的姓名拼写。为了完整起见,您可能需要编辑实际的Liferay版本号-我这里没有所有版本,但您提供的是tomcat版本号,而不是Liferay的版本号。为了跟随Amresh的回答,这里有一个指向Wiki的链接,先生,我已经这样做了。portal-ext.properties文件未退出,然后我创建了具有此名称的新文件,但未连接mysql。感谢您的回答如果您在windows上,请确保资源管理器未隐藏真正的扩展名。您可能已经创建了portal-ext.properties.txt,并在创建数据库指令中添加了“字符集utf8”-这是一条非常重要的指令,因为您所在的平台本身并不默认为该指令。
        1)path--->home/karthik/Desktop/LiferaySetup/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes---->create an empty doc with name as portal-ext.properties
        paste the below code:
        jdbc.default.driverClassName=com.mysql.jdbc.Driver
        jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
        jdbc.default.username=root
        jdbc.default.password=root
        2)path--->/home/karthik/Desktop/LiferaySetup/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/conf/Catalina/localhost-->Enter the below code inside ROOT.xml
         <Context path="" crossContext="true">
    
            <!-- JAAS -->
    
            <!--<Realm
                className="org.apache.catalina.realm.JAASRealm"
                appName="PortalRealm"
                userClassNames="com.liferay.portal.kernel.security.jaas.PortalPrincipal"
                roleClassNames="com.liferay.portal.kernel.security.jaas.PortalRole"
            />-->
    
            <!--
            Uncomment the following to disable persistent sessions across reboots.
            -->
    
            <!--<Manager pathname="" />-->
    
            <!--
            Uncomment the following to not use sessions. See the property
            "session.disabled" in portal.properties.
            -->
    
            <!--<Manager className="com.liferay.support.tomcat.session.SessionLessManagerBase" />-->
        <Resource
            name="jdbc/LiferayPool"
            auth="Container"
            type="javax.sql.DataSource"
            driverClassName="com.mysql.jdbc.Driver"
            url="jdbc:mysql://localhost/lportal?useUnicode=true&amp;characterEncoding=UTF-8"
            username="root"
            password="root"
            maxActive="20"
        />
    
        </Context>
    If you follow the above 2 statements you can create easily