Fórumok

Using MySQL database with a socket connection

Kevin Britton, módosítva 13 év-val korábban

Using MySQL database with a socket connection

New Member Bejegyzések: 9 Csatlakozás dátuma: 2010.09.14. Legújabb bejegyzések
I'm extremely new to LifeRay, and Java in general, but have experience as a web developer.

I'm trying to get SO to work with a MySQL database. On other platforms, I've used a socket connection to access our database. I'm now running into difficulties when using the default MySQL instructions from the manuals and everywhere else on the web.

My portal-ext.properties file shows:

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


I'm not getting to the login screen. I'm landing with exceptions:

03:02:00,191 WARN [BasicResourcePool:1841] com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@3f0cc730 -- Acquisition Attempt Failed!!! Clearing
pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30).
Last acquisition attempt exception:
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.ConnectException
MESSAGE: Connection refused

STACKTRACE:

java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:310)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:176)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:163)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:381)
at java.net.Socket.connect(Socket.java:537)
at java.net.Socket.connect(Socket.java:487)
at java.net.Socket.<init>(Socket.java:384)
at java.net.Socket.<init>(Socket.java:227)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2744)
at com.mysql.jdbc.Connection.<init>(Connection.java:1553)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)


etc.

Do I need to invoke the socket in the default URL? How do I do that from the portal-ext.properties file? Other, PHP-based software has used ':/path/to/socket' format in database-host variables, but I've not had any luck attempting that. Could something else be wrong?

I did set up the user with full permissions in MySQL, and even loaded in the default database manually....but it looks like I'm not even connecting.

Any help the community can offer would be appreciated. If I can't get LifeRay working with MySQL, I'm sunk, because we'll eventually need to migrate data.

Thanks!
thumbnail
William Fleming, módosítva 13 év-val korábban

RE: Using MySQL database with a socket connection

Regular Member Bejegyzések: 180 Csatlakozás dátuma: 2010.09.15. Legújabb bejegyzések
http://paulszulc.wordpress.com/2010/01/19/installing-liferay-with-mysql-cas-and-openldap-on-ubuntu-part-1/

Shows you how to set up the MYSQL database did it myself very good article.
Nick Willey, módosítva 13 év-val korábban

RE: Using MySQL database with a socket connection

Junior Member Bejegyzések: 53 Csatlakozás dátuma: 2010.08.24. Legújabb bejegyzések
Can you try connecting to the database with the MySQL command line client, i.e.:

mysql -h localhost -D lportal -u lportal -p

If you can't connect with the command line client then you at least know it's a permissions issue, and not related to Liferay.

Nick
thumbnail
Apoorva Prakash, módosítva 13 év-val korábban

RE: Using MySQL database with a socket connection

Liferay Master Bejegyzések: 658 Csatlakozás dátuma: 2010.06.15. Legújabb bejegyzések
Hello Kevin,
Every thing seems correct with portal-ext.properties file entries.
One of my colleague got this kind of problem, as he installed the Tomcat and MySQL on the same port.
So, Please ensure that both are installed on different ports.
Regards...
thumbnail
Gustavo Fernández Gómez, módosítva 13 év-val korábban

RE: Using MySQL database with a socket connection

Regular Member Bejegyzések: 191 Csatlakozás dátuma: 2007.10.26. Legújabb bejegyzések
do you want to use jdbc unix native sockets instead of jdbc tcp/ip connections?

http://forums.hyperic.com/jiveforums/message.jspa?messageID=17300
Kevin Britton, módosítva 13 év-val korábban

RE: Using MySQL database with a socket connection

New Member Bejegyzések: 9 Csatlakozás dátuma: 2010.09.14. Legújabb bejegyzések
Thanks everyone for the pointers!

Our problem ended up being relating to security setting put in place by our hosting provider. Specifically, our mysql.conf was set up for IP binding on localhost. LifeRay required the binding to be at the public IP address instead in order to work properly.

We're able to connect now using the default MySQL portal-ext.properties settings, with the exception of using the corresponding xxx.xxx.xxx.xxx:3306 in the default URL.

Thanks again!
khoa nguyen, módosítva 8 év-val korábban

RE: Using MySQL database with a socket connection

New Member Bejegyzés: 1 Csatlakozás dátuma: 2012.12.24. Legújabb bejegyzések
Kevin Britton:
Thanks everyone for the pointers!

Our problem ended up being relating to security setting put in place by our hosting provider. Specifically, our mysql.conf was set up for IP binding on localhost. LifeRay required the binding to be at the public IP address instead in order to work properly.

We're able to connect now using the default MySQL portal-ext.properties settings, with the exception of using the corresponding xxx.xxx.xxx.xxx:3306 in the default URL.

Thanks again!


Thanks u, I have a same problem & I've fixed it by this way!