Database Error.

Ask for help regarding any technical issue or report any bug or OS independent issues.
User avatar
visaboy
Peon
Peon
Posts: 29
Joined: 09 Jan 2011, 06:19

Database Error.

Post by visaboy »

When I open the accountserver it tries to connect to mana.db when I have mysql in the settings.

LOG:

Code: Select all

[18:52:14] [INF] Using log file: ./manaserv-account.log
[18:52:14] [INF] Using statistics file: ./manaserv.stats
[18:52:14] [INF] Trying to connect with SQLite database file 'mana.db'
[18:52:14] [INF] Connection to database successful.
[18:52:14] [ERR] (DALStorage:getWorldStateVar) SQL query preparation failure.
[18:52:14] [FTL] Error opening the database: (DALStorage:getWorldStateVar) SQL query preparation failure.
manaserv.xml

Code: Select all

<?xml version="1.0"?>
<!--
	An example configuration file.

	Documentation: http://doc.manasource.org/manaserv.xml

	Developers:	If you add any new parameters read from this configuration file
	don't forget to update the wiki documentation!
-->
<configuration>

<!-- Database configuration ***************************************************
 Uncomment one of the following parts according to the database backend you
 would like to use.
-->

<!--
	SQLite specific configuration.

	sqlite_database:	name and path to the sqlite database file
						optional, default="mana.db"
-->
<!-- <option name="sqlite_database" value="mana.db"/> -->


<!--
	mySQL specific configuration.

	mysql_hostname:		ip or hostname of the database server
						optional, default="localhost"
	mysql_port:			the port where the mysql server listens to
						optional, default=3306
	mysql_database:		name of the installed database
						optional, default="mana"
	mysql_username:		name of the user to connect to the database server
						optional, default="mana"
	mysql_password:		password to use whith the mysql_username
						optional, default="mana"
-->

<option name="mysql_hostname" value="localhost"/>
<option name="mysql_port" value="3306"/>
<option name="mysql_database" value="mana"/>
<option name="mysql_username" value="root"/>
<option name="mysql_password" value=""/>



<!--
	PostgreSQL specific configuration.

	TODO!
-->

<!-- end of database configuration **************************************** -->

<!-- Paths configuration ******************************************************
 Set here the different paths used by both the server to find data.
-->
 <!-- Paths to data files -->
 <option name="serverPath" value="." />
 <option name="clientDataPath" value="./clientdata" />
 <option name="serverDataPath" value="./serverdata" />

<!-- end of paths configuration ******************************************* -->

<!-- Logs configuration *******************************************************
 Set here the different paths used by both the server
 to store statistics and log files.
-->

 <!--
 Log output configuration, relative to the folders where the servers were ran.
 -->
 <option name="log_statisticsFile" value="./manaserv.stats"/>
 <option name="log_accountServerFile" value="./manaserv-account.log"/>
 <option name="log_gameServerFile" value="./manaserv-game.log"/>

 <!--
 Log levels configuration.
 Available values are:
   0. Fatal Errors only.
   1. All Errors.
   2. Plus warnings.
   3. Plus standard information.
   4. Plus debugging information.
 -->
 <option name="log_gameServerLogLevel" value="2"/>
 <option name="log_accountServerLogLevel" value="2"/>

 <!--
 Enable log rotation when one log file reaches a max size
 and/or the current day has changed.
 -->
 <option name="log_enableRotation" value="false"/>
 <!--
 Set the max log file size. Disabled if set to 0.
 -->
 <option name="log_maxFileSize" value="1024"/>
 <!--
 Change the log file each day.
 -->
 <option name="log_perDay" value="false"/>

<!-- end of logs configuration ****************************************** -->

<!-- Network options configuration ********************************************
 Set here the different network-related options to set up the servers
 hosts and ports, for instance.
-->

 <!--
 ATTENTION: This is a very important option!
 the net password is used to let the servers (game and account) speak to each
 other in a crypted way.
 This option is REQUIRED FOR THE SERVERS TO START.
 -->
 <option name="net_password" value="P@s$w0rd"/>

 <!--
 The game server uses this address to connect to the account server. Clients
 will also need to be able to connect to the account server through it.
 Don't use the 'localhost' value when running a public server,
 but rather the public name.

 The port options set the port to listen to clients and to game servers
 respectively.
 -->
 <option name="net_accountHost" value="localhost"/>
 <option name="net_accountListenToClientPort" value="9601"/>
 <option name="net_accountListenToGamePort" value="9602"/>

 <!--
 Host the chat server will listen to. Defaulted to 'localhost'.
 Don't use the 'localhost' value when running a public server,
 but rather the public name.
 -->
 <option name="net_chatHost" value="localhost"/>
 <option name="net_chatListenToClientPort" value="9603"/>

 <!--
 The clients use this address to connect to a game server on this machine.
 Don't use the 'localhost' value when running a public server,
 but rather the public name.
 -->
 <option name="net_gameHost" value="localhost"/>
 <option name="net_gameListenToClientPort" value="9604"/>

 <!--
 Update host url: E.g.: "http://updates.manasource.org/"
 It gives the http folder where the update files can be downloaded.
 -->
 <option name="net_defaultUpdateHost" value="" />

 <!--
 Client data url: E.g.: "http://data.manasource.org/"
 Example for local use: "file:///home/user/clientdata/"
 The base URL where the client will get its data from. This is a new update
 mechanism that replaces the update host, used by the Mana Mobile client.
 -->
 <option name="net_clientDataUrl" value="" />

 <!--
 Minimal supported mana client version.
 The current version is 0.
 -->
 <option name="net_clientVersion" value="0" />

 <!-- Max connected clients allowed. -->
 <option name="net_maxClients" value="1000"/>

<!-- end of network options configuration ********************************* -->

<!-- Accounts configuration ***************************************************
 Set here the different options related to players accounts
 and used at their creation.
-->

 <option name="account_allowRegister" value="1" />
 <option name="account_denyRegisterReason"
         value="The server administrator has disabled automatic registration!"/>
 <option name="account_minEmailLength" value="7" />
 <option name="account_maxEmailLength" value="128" />
 <option name="account_minNameLength" value="4" />
 <option name="account_maxNameLength" value="15" />
 <option name="account_minPasswordLength" value="6" />
 <option name="account_maxPasswordLength" value="25" />
 <option name="account_maxCharacters" value="3" />

<!-- end of accounts configuration **************************************** -->

<!-- Characters configuration *************************************************
 Set here the different options related to players characters.
-->

 <option name="char_numHairStyles" value="17" />
 <option name="char_numHairColors" value="11" />
 <option name="char_numGenders" value="2" />
 <option name="char_minNameLength" value="4" />
 <option name="char_maxNameLength" value="25" />

 <!--
 New player starting location. The map should be defined in data/maps.xml.
 -->
 <option name="char_startMap" value="1"/>
 <!--
     Respawn coordinates on the start map:
     In pixels, not in tiles.
 -->
 <option name="char_startX" value="1024"/>
 <option name="char_startY" value="1024"/>

 <!-- Respawn options -->
 <option name="char_respawnMap" value="1"/>
 <!--
     Respawn coordinates on the respawn map:
     In pixels, not in tiles.
 -->
 <option name="char_respawnX" value="1024"/>
 <option name="char_respawnY" value="1024"/>

 <!-- Default Map id at character loading -->
 <option name="char_defaultMap" value="1" />

<!-- end of characters configuration ************************************** -->

<!-- Game configuration *************************************************
 Set here the different options related to the gameplay.
-->

 <!--
 Set the player's character visual range around him in pixels.
 Monsters and other beings further than this value won't appear in its sight.
 -->
 <option name="game_visualRange" value="448"/>
 <!--
 The time in seconds an item standing on the floor will remain before vanishing.
 Set it to 0 to disable it.
 -->
 <option name="game_floorItemDecayTime" value="0" />

 <!--
 Set how much time the auto-regeneration is stopped when hurt.
 (in 1/10th seconds.)
 -->
 <option name="game_hpRegenBreakAfterHit" value="0" />

 <!--
 Default PVP (Player-versus-player) rule on a map not setting this property.
 Values available: none (No PVP), free (All PVP).
 -->
 <option name="game_defaultPvp" value="" />

<!-- end of game configuration ******************************************** -->

<!-- Commands configuration ***************************************************
 Set here the different options related to chat commands.
-->

 <!--
 Default mute command length (in seconds.)
 -->
 <option name="command_defaultMuteLength" value="60" />

<!-- end of commands configuration **************************************** -->

<!-- Chat configuration ***************************************************
 Set here the different options related to chat handling.
-->

 <option name="chat_maxChannelNameLength" value="15" />

 <!--
 TODO: Dehard-code those values, or redo the chat channeling system
 to not make use of them.
        MAX_PUBLIC_CHANNELS_RANGE  = 1000,
        MAX_PRIVATE_CHANNELS_RANGE = 10000,
        MAX_CHANNEL_ANNOUNCEMENT   = 150,
        MAX_CHANNEL_PASSWORD       = 12,
 -->

<!-- end of chat configuration ******************************************** -->

<!-- Mail configuration ***************************************************
 Set here the different options related to the mail system.
-->

 <option name="mail_maxAttachments" value="3" />
 <option name="mail_maxLetters" value="10" />

<!-- end of mail configuration ******************************************** -->

</configuration>
I compiled the server last night.
How can I make it connect to mysql and not sqlite?

Thank you.

PS: I already read (http://doc.manasource.org/database_installation) but the MySQL Information is incomplete after "Configuring ManaServ to use the database"
“If it moves, fondle it - except porcupines, ball lightning, and policemen” :)
User avatar
Jaxad0127
Manasource
Manasource
Posts: 4209
Joined: 01 Nov 2007, 17:35
Location: Internet

Re: Database Error.

Post by Jaxad0127 »

You need to compile it to use MySQL instead of SQLite:

Code: Select all

cmake -DWITH_MYSQL=1
Image
User avatar
Bertram
Manasource
Manasource
Posts: 1026
Joined: 07 Sep 2004, 14:55
Location: France

Re: Database Error.

Post by Bertram »

Hi,

I updated the compilation page with details about how to change the supported db:
http://doc.manasource.org/compile_manas ... ce?&#linux

Thanks for highlighting this lack of documentation.

Best regards.
User avatar
visaboy
Peon
Peon
Posts: 29
Joined: 09 Jan 2011, 06:19

Re: Database Error.

Post by visaboy »

This issue is from a windows compilation.

How do I tell "CodeBlock" to compile using mysql libraries?
“If it moves, fondle it - except porcupines, ball lightning, and policemen” :)
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Re: Database Error.

Post by Crush »

visaboy wrote:This issue is from a windows compilation.

How do I tell "CodeBlock" to compile using mysql libraries?
Then why did you post in Linux/UNIX support??

Moved to windows support.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
Bertram
Manasource
Manasource
Posts: 1026
Joined: 07 Sep 2004, 14:55
Location: France

Re: Database Error.

Post by Bertram »

Hi,

At least the linux compile documentation has been updated.

Now, for C::B, go to the Project -> Build options menu, select the default target and the #define tab of the compiler options :
build-options.png
build-options.png (26.02 KiB) Viewed 6025 times
Change the 'SQLITE_SUPPORT' line with MYSQL_SUPPORT

Click ok, and try compiling.

An issue is open about the lack of proper target for account server here:
http://bugs.manasource.org/view.php?id=61

If anyone is ready to add the missing target in the official cbp file, I'd be glad of it, too :)

Best regards.
User avatar
Bertram
Manasource
Manasource
Posts: 1026
Joined: 07 Sep 2004, 14:55
Location: France

Re: Database Error.

Post by Bertram »

Hi again,

Can you try with replacing the accountserver.cbp file with that one?
accountserver.zip
(1.56 KiB) Downloaded 109 times
Tell me whether it fixes your issue. (You'll need the mysql include and dll files if you try compiling against mySQL.)

Best regards.
User avatar
Mpa4Hu
Novice
Novice
Posts: 58
Joined: 18 Jul 2009, 12:26

Re: Database Error.

Post by Mpa4Hu »

Bertram wrote:Hi again,

Can you try with replacing the accountserver.cbp file with that one?


Tell me whether it fixes your issue. (You'll need the mysql include and dll files if you try compiling against mySQL.)

Best regards.
hi, this cbp files works but i still have proble
mysqlerror.png
mysqlerror.png (27.67 KiB) Viewed 5949 times
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Re: Database Error.

Post by Crush »

You are missing the MySQL headers and libraries. So far I only found the sourcecode and no precompiled binary libraries for MinGW.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
Mpa4Hu
Novice
Novice
Posts: 58
Joined: 18 Jul 2009, 12:26

Re: Database Error.

Post by Mpa4Hu »

wow, it's really hard to make it )))

okay so, what i did

1) I downloaded MySQL
2) Copied all libraries to my libraries/mysql
3) downloaded pexports.exe
4) with prexports I exported libmysql.def from libmysql.dll in "mysql/lib" folder

Code: Select all

pexports libmysql.dll > libmysql.def
libmysql.def content:

Code: Select all

LIBRARY libmysql.dll
EXPORTS
load_defaults
myodbc_remove_escape
mysql_affected_rows
mysql_autocommit
mysql_change_user
mysql_character_set_name
mysql_close
mysql_commit
mysql_data_seek
mysql_debug
mysql_dump_debug_info
mysql_embedded
mysql_eof
mysql_errno
mysql_error
mysql_escape_string
mysql_fetch_field
mysql_fetch_field_direct
mysql_fetch_fields
mysql_fetch_lengths
mysql_fetch_row
mysql_field_count
mysql_field_seek
mysql_field_tell
mysql_free_result
mysql_get_character_set_info
mysql_get_client_info
mysql_get_client_version
mysql_get_host_info
mysql_get_proto_info
mysql_get_server_info
mysql_get_server_version
mysql_get_ssl_cipher
mysql_hex_string
mysql_info
mysql_init
mysql_insert_id
mysql_kill
mysql_list_dbs
mysql_list_fields
mysql_list_processes
mysql_list_tables
mysql_more_results
mysql_next_result
mysql_num_fields
mysql_num_rows
mysql_options
mysql_ping
mysql_query
mysql_read_query_result
mysql_real_connect
mysql_real_escape_string
mysql_real_query
mysql_refresh
mysql_rollback
mysql_row_seek
mysql_row_tell
mysql_select_db
mysql_send_query
mysql_server_end
mysql_server_init
mysql_set_character_set
mysql_set_local_infile_default
mysql_set_local_infile_handler
mysql_set_server_option
mysql_shutdown
mysql_sqlstate
mysql_ssl_set
mysql_stat
mysql_stmt_affected_rows
mysql_stmt_attr_get
mysql_stmt_attr_set
mysql_stmt_bind_param
mysql_stmt_bind_result
mysql_stmt_close
mysql_stmt_data_seek
mysql_stmt_errno
mysql_stmt_error
mysql_stmt_execute
mysql_stmt_fetch
mysql_stmt_fetch_column
mysql_stmt_field_count
mysql_stmt_free_result
mysql_stmt_init
mysql_stmt_insert_id
mysql_stmt_next_result
mysql_stmt_num_rows
mysql_stmt_param_count
mysql_stmt_param_metadata
mysql_stmt_prepare
mysql_stmt_reset
mysql_stmt_result_metadata
mysql_stmt_row_seek
mysql_stmt_row_tell
mysql_stmt_send_long_data
mysql_stmt_sqlstate
mysql_stmt_store_result
mysql_store_result
mysql_thread_end
mysql_thread_id
mysql_thread_init
mysql_thread_safe
mysql_use_result
mysql_warning_count
5) with dlltool.exe I try to compile libmysql.def

Code: Select all

dlltool -k --input-def libmysql.def --dllname libmysql.dll --output-lib libmysql.a
I tried various options, but libmysql.a compiles with 0 byte

maybe it's because of win7?
can someone make it?
http://www.mediafire.com/?8o28yig324spn4h
here is dlltool.exe, pexport.exe and libmysql.dll
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Re: Database Error.

Post by Crush »

Instead of working with the already compiled DLL I would rather download the sourcecode of the mySQL library and try to compile it myself.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
Mpa4Hu
Novice
Novice
Posts: 58
Joined: 18 Jul 2009, 12:26

Re: Database Error.

Post by Mpa4Hu »

okay i finally did it

here is the pack if somebody wants it too
http://rapidshare.com/files/448435991/mysql.rar
dll
include
lib


works fine with me
User avatar
Bertram
Manasource
Manasource
Posts: 1026
Joined: 07 Sep 2004, 14:55
Location: France

Re: Database Error.

Post by Bertram »

Hi,

Great. Were you able to compile fine, using my accountserver.cbp file?

Best regards.
User avatar
Mpa4Hu
Novice
Novice
Posts: 58
Joined: 18 Jul 2009, 12:26

Re: Database Error.

Post by Mpa4Hu »

hi
yes ^_^
User avatar
Bertram
Manasource
Manasource
Posts: 1026
Joined: 07 Sep 2004, 14:55
Location: France

Re: Database Error.

Post by Bertram »

Hi,

Righty eh :)

I'll push the file in the repo asap.

Thanks for the effort and best regards.

(N.B. : The latest GIT has monsters spawning, working money handling, and buy/sell support back. Don't forget to update ;])
Post Reply