rafaelsteil / jforum2

JForum 2.x series. Please see the README
http://jforum.net
Other
53 stars 48 forks source link

MySQL error #8

Open mhenrysson opened 12 years ago

mhenrysson commented 12 years ago

Hi,

Got this one when trying to set up jForum on JBoss AS 7.0.2 Final and MySQL 5.5.18 (after realising I had to set up the MySQL properties BEFORE installing. Might want to put a note on that in the install instructions).

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=InnoDB' at line 1 CREATE TABLE jforum_banlist ( banlist_id INT NOT NULL auto_increment, user_id INT, banlist_ip varchar(15), banlist_email varchar(255), PRIMARY KEY (banlist_id), INDEX idx_user (user_id), INDEX (banlist_ip), INDEX (banlist_email)) TYPE=InnoDB

Google gave me this http://www.zabbix.com/forum/showthread.php?t=17543 for what it's worth.

Thanks

scribe74 commented 12 years ago

For MySQL version 5.1 (I think) and above, all instances of TYPE=InnoDB in the file config/database/mysql/mysql_db_struct.sql need to be replaced with ENGINE=InnoDB.

Iuminaryone - If you're stuck and didn't understand the thread you referenced, just go into that file and make the changes and the install will work.

The solution for a jForum fix would be to query the MySQL version to be used and use an appropriate version of the file.

fernandoacorreia-benner commented 12 years ago

Same issue with MySQL 5.5.24-0ubuntu0.12.04.1. Doing the text replacement suggested above on mysql_db_struct.sql results in another error on

CREATE TABLE jforum_privmsgs_text ( privmsgs_id INT NOT NULL,   privmsgs_text TEXT, PRIMARY KEY ( privmsgs_id )) Type=InnoDB

There are other .sql files that need to be changed as well, for instance in the upgrade directory.

This command, executed from the jforum installation directory, resulted in a successful installation:

$ find -name *.sql -type f -exec sed -i 's/TYPE=InnoDB/ENGINE=InnoDB/gi' {} \;
2Ding commented 6 years ago

尝试设置数据库时发生错误. 请检查帐号、密码和主机等参数是否正确, 然后再试一次. 这是什么原因 com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Server connection failure during transaction. Due to underlying exception: 'java.sql.SQLException: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.'.

BEGIN NESTED EXCEPTION

java.sql.SQLException MESSAGE: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.

STACKTRACE:

java.sql.SQLException: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910) at com.mysql.jdbc.Connection.configureClientCharacterSet(Connection.java:2342) at com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:3861) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2787) at com.mysql.jdbc.Connection.(Connection.java:1531) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:270) at net.jforum.SimpleConnection.getConnection(SimpleConnection.java:94) at net.jforum.SimpleConnection.init(SimpleConnection.java:74) at net.jforum.view.install.InstallAction.configureDatabase(InstallAction.java:679) at net.jforum.view.install.InstallAction.doInstall(InstallAction.java:172) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.jforum.Command.process(Command.java:114) at net.jforum.view.install.InstallAction.process(InstallAction.java:915) at net.jforum.InstallServlet.service(InstallServlet.java:141) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2555) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2544) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)

END NESTED EXCEPTION

Attempted reconnect 3 times. Giving up.