-1

I need to setup a MySQL database for a DataNucleus properties file:

javax.jdo.PersistenceManagerFactoryClass=org.datanucleus.api.jdo.JDOPersistenceManagerFactory
datanucleus.metadata.validate=false

# Enable these lines if persisting to ODF
#javax.jdo.option.ConnectionURL=odf:file:tutorial.ods
#javax.jdo.option.Mapping=odf

# Enable these lines if persisting to RDBMS (HSQLDB)
javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
javax.jdo.option.ConnectionURL=jdbc:mysql://myserver.com:3306/myDb
javax.jdo.option.ConnectionUserName=userName
javax.jdo.option.ConnectionPassword=password
# javax.jdo.option.Mapping=hsql
datanucleus.autoCreateSchema=true
datanucleus.validateTables=false
datanucleus.validateConstraints=false

Can anyone please tell me the steps on how to set it up for this particular purpose?

achingfingers
  • 1,827
  • 5
  • 24
  • 48

1 Answers1

1

Since you have autoCreateSchema enabled, you do not need to create the schema. All you need to do is create the database itself. Install mysql if necessary, log in to mysql as root and then issue the create database command. If you do not have root access, consult the documentation or the administrator for your server. You can find many tutorials online for this task, please read them before asking further questions.

Community
  • 1
  • 1
Robin Green
  • 32,079
  • 16
  • 104
  • 187
  • I already set up the sever with Mysql and I logged in as root. now I'm receiving the following exception: Expected stackmap frame at this location. they said that the workaraound for this is to include -noverify when compaling. where should I add that command if I'm using the "ant createschema" – user3147232 Jan 04 '14 at 18:43
  • Great! So just go in to mysql and issue the create database command. From your configuration file it looks like your database should be called `myDb`. – Robin Green Jan 04 '14 at 18:44
  • this is the log: [ec2-user@ip-172-31-8-38 datastore]$ ant createschema [schematool] Exception Details: [schematool] Location: [schematool] ips/data/entities/BaseStation.jdoReplaceFlags()V @4: ifnull [schematool] Reason: [schematool] Expected stackmap frame at this location. [schematool] Bytecode: [schematool] 0000000: 2ab4 00a6 c600 112a 2ab4 00a6 2ab9 0107 [schematool] 0000010: 0200 b501 09b1 [schematool] – user3147232 Jan 04 '14 at 18:51
  • I suspect that error has nothing to do with your mysql database. – Robin Green Jan 04 '14 at 18:53