掲示板

how to connect with MYSQL Database?

15年前 に Gunjan Sherathia によって更新されました。

how to connect with MYSQL Database?

Junior Member 投稿: 47 参加年月日: 09/02/21 最新の投稿
hi

i want to connect my application with mysql....

i have gone through the document liferay development documentation 5.0 which is available on liferay website...when i was implementing it i come across root.xml file.....document says us to comment hypersonic database & to uncomment mysql darabase....when i doo that & when i try to run localhost:8080 i got error

"http-status 404 resource not found"

can anybody tell me how can i proceed further...

it would b really helpful to me to hear from u guys...plz reply me...

as project deadline is coming i m in urgent need to do this .....
15年前 に Evert Lammerts によって更新されました。

RE: how to connect with MYSQL Database?

New Member 投稿: 24 参加年月日: 08/10/10 最新の投稿
I assume you DID update the table, username and password information for your connection in ROOT.xml, that you have restarted the portal and that MySQL is running? 404 not found means the portal is not running and catalina didn't start up. Please attach your logs/catalina.out to your next post.
15年前 に Gunjan Sherathia によって更新されました。

RE: how to connect with MYSQL Database?

Junior Member 投稿: 47 参加年月日: 09/02/21 最新の投稿
hi
thanks Evert for reply

there is no username & password for that database...i am using WAMP server(WWW directory,Apache,Mysql,PhpMyadmin) so i started all servces of wamp server. so Mysql is also running....but how do liferay come to know that my mysql is running? i mean we havnt done anything so that our application store in mysql....as u know by default its in hypersonic....in root.xml file we have description for all the database so uncomment mysql ...

when i use hypersonic database catalina is starting up......but when i change my root.xml to mysql it didnt work.....

we have not created any table or database in mysql then how will liferay know that there is mysql database & it needs to be connect to it?
i cant see any link between liferay & mysql

hope to listen from u...
15年前 に Evert Lammerts によって更新されました。

RE: how to connect with MYSQL Database?

New Member 投稿: 24 参加年月日: 08/10/10 最新の投稿
You need to create a database in MySQL, the name of which needs to be specified in the connection string in ROOT.xml (the default name is 'lportal', I believe). I don't think it's possible to have a blank username in MySQL. Try to use 'root' as a username. Not using a password is ALWAYS a bad idea.

By the sound of your problem I think you should go through tutorials. For Liferay the wiki and the forum is as far as documentation goes, but Google is packed with information on MySQL. Any runtime information can be found in the logs.
15年前 に Gunjan Sherathia によって更新されました。

RE: how to connect with MYSQL Database?

Junior Member 投稿: 47 参加年月日: 09/02/21 最新の投稿
Hi Evert

i have changed my root.xml & add username root & it worked...

thanks Evert.
thumbnail
15年前 に Jonas Yuan によって更新されました。

RE: how to connect with MYSQL Database?

Liferay Master 投稿: 993 参加年月日: 07/04/27 最新の投稿
Hi Gunjan and Evert,

Liferay v5.2 and later

Liferay v5.2 unifies the configuration of the database in a single file for all application servers. As most other configuration options you can set this up in the portal-ext.properties file as follows (example for MySQL):

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=
If you do not have an existing portal-ext.properties file, you can create one and save it to:

{liferay-home}\{tomcat}\webapps\ROOT\WEB-INF\classes

for Tomcat.

Thanks

Jonas Yuan
15年前 に Gunjan Sherathia によって更新されました。

RE: how to connect with MYSQL Database?

Junior Member 投稿: 47 参加年月日: 09/02/21 最新の投稿
hi josan

thanks for reply

i have made that changed & it work....but when i remove that change to portal-ext.properties it work then also....

thanks & regards
Gunjan
9年前 に Prakhar Sinha によって更新されました。

RE: how to connect with MYSQL Database?

New Member 投稿: 1 参加年月日: 14/07/04 最新の投稿
Hi.

Is the procedure the same for Liferay 6.2?