How does traccar know the mysql database to use ?.

realnumber9 years ago

I am trying to use mysql in traccar but i cannot understand why there is no database field in

<entry key='database.driver'>com.mysql.jdbc.Driver</entry> 
    <entry key='database.url'>jdbc:mysql://127.0.0.1:3306/[DATABASE]?allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=ANSI_QUOTES</entry>
    <entry key='database.user'>welshyard_fleet</entry> 
    <entry key='database.password'>123456</entry>

I was expecting an entry key for database.name for instance.I am creating my databases from cpanel so,i will never have a database named traccar but instead my databases will be in the form welshyard_dbname

welshyard is my cpanel choosen username.

How do i include information about the database traccar can use on the configuration file?.

Anton Tananaev9 years ago

You need to replace [DATABASE] with your database name.

realnumber9 years ago

<entry key='database.url'>jdbc:mysql://127.0.0.1:3306/[DATABASE]?allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=ANSI_QUOTES</entry>

Do i replace the [] in [DATABASE] also or are the [] part of the string?

realnumber9 years ago

Awesome. I made it to work.

Thanks.

cosmic2 years ago

@Anton from where I can get the database name?