Cannot connect to database, (amx_sql_prefix)

Diamond
Posts: 2
Joined: 26 May 2013, 13:32

Cannot connect to database, (amx_sql_prefix)

Postby Diamond » 31 May 2013, 09:54

amxmodx logs:

Code: Select all

L 05/31/2013 - 14:45:42: -------- Mapchange to de_dust2 --------
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] Query failed!
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] Threaded Query Error, Place: 1
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] Message: Table 'amx_bans._serverinfo' doesn't exist (1146)
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] Query statement: SELECT `motd_delay` FROM `_serverinfo` WHERE address = '1.1.1.1:28015'
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] Query failed!
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] Threaded Query Error, Place: 5
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] Message: Table 'amx_bans._reasons' doesn't exist (1146)
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] Query statement:
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] No Reasons found in Database. Static reasons were loaded instead.
L 05/31/2013 - 14:45:53: [amxbans_main.amxx] [AMXBans] Query failed!
L 05/31/2013 - 14:45:53: [amxbans_main.amxx] [AMXBans] Threaded Query Error, Place: 17
L 05/31/2013 - 14:45:53: [amxbans_main.amxx] [AMXBans] Message: Table 'amx_bans._bans' doesn't exist (1146)
L 05/31/2013 - 14:45:53: [amxbans_main.amxx] [AMXBans] Query statement:
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Query failed!
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Threaded Query Error, Place: 17
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Message: Table 'amx_bans._bans' doesn't exist (1146)
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Query statement:
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Query failed!
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Threaded Query Error, Place: 17
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Message: Table 'amx_bans._bans' doesn't exist (1146)
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Query statement:
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Query failed!
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Threaded Query Error, Place: 17
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Message: Table 'amx_bans._bans' doesn't exist (1146)
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Query statement:


sql.cfg:

Code: Select all

amx_sql_host    "127.0.0.1"
amx_sql_user    "amx_bans"
amx_sql_pass    "my_password"
amx_sql_db      "amx_bans"
amx_sql_table   "admins"
amx_sql_type    "mysql"


screenlog grep AMXBans:

Code: Select all

[AMXBans] is starting to execute amxbans.cfg
[AMXBans] amxbans.cfg is fully executed
[AMXBans] Loaded 0 admins from database
[AMXBans] Loaded 0 admins from database
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] Query failed!
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] Threaded Query Error, Place: 1
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] Message: Table 'amx_bans._serverinfo' doesn't exist (1146)
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] Query statement: SELECT `motd_delay` FROM `_serverinfo` WHERE address = '1.1.1.1:28015'
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] Query failed!
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] Threaded Query Error, Place: 5
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] Message: Table 'amx_bans._reasons' doesn't exist (1146)
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] Query statement:
[AMXBans] No Reasons found
[AMXBans] No Reasons found in Database. Static reasons were loaded instead.
L 05/31/2013 - 14:45:43: [amxbans_main.amxx] [AMXBans] No Reasons found in Database. Static reasons were loaded instead.
Menu item 19 added to Menus Front-End: "AMXBans: Player-Flagging" from plugin "AMXBans Main"
Menu item 20 added to Menus Front-End: "AMXBans: Disconnected Players" from plugin "AMXBans Main"
Menu item 21 added to Menus Front-End: "AMXBans: Banhistory" from plugin "AMXBans Main"
L 05/31/2013 - 14:45:53: [amxbans_main.amxx] [AMXBans] Query failed!
L 05/31/2013 - 14:45:53: [amxbans_main.amxx] [AMXBans] Threaded Query Error, Place: 17
L 05/31/2013 - 14:45:53: [amxbans_main.amxx] [AMXBans] Message: Table 'amx_bans._bans' doesn't exist (1146)
L 05/31/2013 - 14:45:53: [amxbans_main.amxx] [AMXBans] Query statement:
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Query failed!
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Threaded Query Error, Place: 17
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Message: Table 'amx_bans._bans' doesn't exist (1146)
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Query statement:
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Query failed!
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Threaded Query Error, Place: 17
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Message: Table 'amx_bans._bans' doesn't exist (1146)
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Query statement:
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Query failed!
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Threaded Query Error, Place: 17
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Message: Table 'amx_bans._bans' doesn't exist (1146)
L 05/31/2013 - 14:45:54: [amxbans_main.amxx] [AMXBans] Query statement:


I am using the default amxbans.cfg file.

Code: Select all

// AMXBans Configuration File
// File location: $moddir/addons/amxmodx/configs/amxbans.cfg
echo [AMXBans] is starting to execute amxbans.cfg

// Your SQL database prefix
// NOTE: The Prefix defined in your sql.cfg is NOT used for AMXBans anymore!!!
amx_sql_prefix "amx"

// How AMXBans should handle the admins
// 0 = SQL, 1 = users.ini, 2 = load no admins
amxbans_use_admins_file 0

// AMXBans tries to get the address from the server automatically.
// You can set a different one here - ex. "<ip>:<port>"
amxbans_server_address ""

// Number of players in the Disconnected Menu
amxbans_discon_players_saved 10

// Bantime to use for custom banreasons, if a user has static bantime <minutes>
// -1 to disable custom reasons
amxbans_custom_statictime 1440

// Set this cvar to what the adminname should be on the webpages, if the server make the ban.
// Ie. amxbans_servernick "My Great server"
// Leave emty if you want to use the default hostname from server.cfg
amxbans_servernick ""

// Set this to 1 / 2 / 3 to enable debug messages from amxbans to amxx logs.
// with debug 3 you get the most output, but a bug can flood your logs. 2 should be ok normally
amxbans_debug 0

// Don't use http:// in this cvar. The url will be shown to banned players in the console.
amxbans_complain_url "www.yoururl.com"

// Set this to 1 if you want the map name to show in the DB.
amxbans_add_mapname_in_servername 1

// If you want to see ban announcments in the HLSW chat, set this to 1
amxbans_show_in_hlsw 1

// Print green hudmessages on the top left when banning
amxbans_show_hud_messages 1

// What flag should admins have to get the high ban times.
amxbans_higher_ban_time_admin "n"

// What flag should admins have to NOT get their Nick printed when banning/Unbanning
amxbans_admin_mole_access "r"

// If an admin has the admin_mole_access, should his name be shown when he bans?
amxbans_show_name_evenif_mole 1

// Show if a player has been banned before as amx_chat to admins. 0 to disable
amxbans_show_prebanned 1

// How many previous offences does the player needs, to be notified in the amx_chat?
amxbans_show_prebanned_num 2

// Currently not known
amxbans_default_ban_reason unknown

// To be able to ban players not in the server. 1 enabled and 0 disabled.
amxbans_ban_evenif_disconnected 1

// Flagtimes, like the bantimes below
amx_setflagtimes "1 h" "4 h" "10 h" "1 d" "1 w" "4 w" "12 w" "0"

// Ban times for admins with d-flag, set the highest time in minutes they can ban with "amx_ban"
// IMPORTANT: Put the lowest value first and the highest value last. You can  have 1 to 14 values
// "0 m" = permanent ban!
// Values you can use:
// 1 - 59 with the flag m is for minutes
// 1 - 23 with the flag h is for hours
// 1 - 6 with the flag d is for days
// The w flag is for weeks
   
// Example:
// "5 m" is 5 minutes
// "1 h" is 1 hour
// "1 d" is 1 day
// "1 w" is 1 week

amx_setlowbantimes "5 m" "30 m" "1 h" "3 h" "10 h" "1 d"

// Ban times for admin with n-flag and d-flag
// IMPORTANT: Put the lowest value first and the highest value last. You can have 1 to 14 values
// "0 m" = permanent ban!
// Values you can use:
// 1 - 59 with the flag m is for minutes
// 1 - 23 with the flag h is for hours
// 1 - 6 with the flag d is for days
// The w flag is for weeks
//
// Example:
// "5 m" is 5 minutes
// "1 h" is 1 hour
// "1 d" is 1 day
// "1 w" is 1 week

amx_sethighbantimes "5 m" "30 m" "1 h" "3 h" "1 d" "1 w" "0 m"

/*********************************************************************************/

// 3rd party amxbans plugins
// needs the amxbans_freeze plugin
//
//   "a" = freeze
//   "b" = strip weapons
//   "c" = block chat
//   "d" = player glow red (not tested)
amxbans_freeze_mode "abc"

// Use the flagging only for this Server, or for all servers?
// needs the amxbans_flagged plugin
amxbans_flagged_all_server 1

/*********************************************************************************/

// AMXBans configuration file echo
echo [AMXBans] amxbans.cfg is fully executed


From what I see, the amx_sql_prefix variable wasn't loaded, then the query is fail.
How can I fix this?

Thanks.

Diamond
Posts: 2
Joined: 26 May 2013, 13:32

Re: Cannot connect to database, (amx_sql_prefix)

Postby Diamond » 31 May 2013, 10:16

It seems that changing the map will make the cvar loads. Why it doesn't load at the first time we started server?

YamiKaitou
Amxbans Developer
Posts: 257
Joined: 17 Apr 2013, 14:09

Re: Cannot connect to database, (amx_sql_prefix)

Postby YamiKaitou » 31 May 2013, 12:03

Enabling debug will let you know if it is reading the cvar on first start


Return to “Bugs”

Who is online

Users browsing this forum: No registered users and 1 guest