-
install sql script
Posted on May 27th, 2009 No commentsI have a file name:
srtsql.conf
I dont know how to install it..
if it is .sql i know how to do it..Please help me…
I have attached the script
# this file determines the layout of the PvPGN SQL database
# the server will create the tables with their columns as specified in here
# don’t forget to create the DB yourself
# no empty lines allowed, no whitespaces in front of any entries allowed
# file format:
# [name_of_a_table]
# “column_name with format infos”,”default value” [&& "sqlcommand to execute on success"] [|| "sqlcommand to execute on failure"]
# :”sqlcommand to execute” [&& "sqlcommand to execute on success"] [|| "sqlcommand to execute on failure"]
# you might also notice some variables of the form ${variable}. these are
# replaced with their meaning when the server starts
# ${prefix} is replaced with the configured table prefix from bnetd.conf/storage_path
#
# For the “sql” SQL layout
#
[${prefix}BNET]
“uid int NOT NULL PRIMARY KEY”,”‘0′”
“acct_username varchar(32)”,”NULL”
“username varchar(32)”,”NULL” && “UPDATE ${prefix}BNET SET username = lower(acct_username)”
“acct_userid int”,”NULL”
“acct_passhash1 varchar(128)”,”NULL”
“acct_email varchar(128)”,”NULL”
“auth_admin varchar(16)”,”‘false’”
“auth_normallogin varchar(16)”,”‘true’”
“auth_changepass varchar(16)”,”‘true’”
“auth_changeprofile varchar(16)”,”‘true’”
“auth_botlogin varchar(16)”,”‘true’”
“auth_operator varchar(16)”,”‘false’”
“new_at_team_flag int”,”‘0′”
“auth_lockk varchar(16)”,”‘0′”
“auth_command_groups varchar(128)”,”‘1′”
“acct_lastlogin_time int”,”‘0′”
“acct_lastlogin_owner varchar(128)”,”NULL”
“acct_lastlogin_clienttag varchar(128)”,”NULL”
“acct_lastlogin_ip varchar(32)”,”NULL”
:”DROP INDEX username”
:”CREATE UNIQUE INDEX username2 ON ${prefix}BNET (username)”
[${prefix}WOL]
“uid int NOT NULL PRIMARY KEY”,”‘0′”
“auth_apgar varchar(8)”,”NULL”
[${prefix}friend]
“uid int NOT NULL PRIMARY KEY”,”‘0′”
[${prefix}profile]
“uid int NOT NULL PRIMARY KEY”,”‘0′”
“sex varchar(16)”,”NULL”
“location varchar(128)”,”NULL”
“description varchar(256)”,”NULL”
“age varchar(16)”,”NULL”
“clanname varchar(48)”,”NULL”
[${prefix}Record]
“uid int NOT NULL PRIMARY KEY”,”‘0′”
“WAR3_solo_xp int”,”‘0′”
“WAR3_solo_level int”,”‘0′”
“WAR3_solo_wins int”,”‘0′”
“WAR3_solo_rank int”,”‘0′”
“WAR3_solo_losses int”,”‘0′”
“WAR3_team_xp int”,”‘0′”
“WAR3_team_level int”,”‘0′”
“WAR3_team_rank int”,”‘0′”
“WAR3_team_wins int”,”‘0′”
“WAR3_team_losses int”,”‘0′”
“WAR3_ffa_xp int”,”‘0′”
“WAR3_ffa_rank int”,”‘0′”
“WAR3_ffa_level int”,”‘0′”
“WAR3_ffa_wins int”,”‘0′”
“WAR3_ffa_losses int”,”‘0′”
“WAR3_orcs_wins int”,”‘0′”
“WAR3_orcs_losses int”,”‘0′”
“WAR3_humans_wins int”,”‘0′”
“WAR3_humans_losses int”,”‘0′”
“WAR3_undead_wins int”,”‘0′”
“WAR3_undead_losses int”,”‘0′”
“WAR3_nightelves_wins int”,”‘0′”
“WAR3_nightelves_losses int”,”‘0′”
“WAR3_random_wins int”,”‘0′”
“WAR3_random_losses int”,”‘0′”
“WAR3_teamcount int”,”‘0′”
“WAR3_userselected_icon varchar(16)”,”NULL”
“W3XP_solo_xp int”,”‘0′”
“W3XP_solo_level int”,”‘0′”
“W3XP_solo_wins int”,”‘0′”
“W3XP_solo_rank int”,”‘0′”
“W3XP_solo_losses int”,”‘0′”
“W3XP_team_xp int”,”‘0′”
“W3XP_team_level int”,”‘0′”
“W3XP_team_rank int”,”‘0′”
“W3XP_team_wins int”,”‘0′”
“W3XP_team_losses int”,”‘0′”
“W3XP_ffa_xp int”,”‘0′”
“W3XP_ffa_rank int”,”‘0′”
“W3XP_ffa_level int”,”‘0′”
“W3XP_ffa_wins int”,”‘0′”
“W3XP_ffa_losses int”,”‘0′”
“W3XP_orcs_wins int”,”‘0′”
“W3XP_orcs_losses int”,”‘0′”
“W3XP_humans_wins int”,”‘0′”
“W3XP_humans_losses int”,”‘0′”
“W3XP_undead_wins int”,”‘0′”
“W3XP_undead_losses int”,”‘0′”
“W3XP_nightelves_wins int”,”‘0′”
“W3XP_nightelves_losses int”,”‘0′”
“W3XP_random_wins int”,”‘0′”
“W3XP_random_losses int”,”‘0′”
“W3XP_teamcount int”,”‘0′”
“W3XP_userselected_icon varchar(16)”,”NULL”
“STAR_0_wins int”,”‘0′”
“STAR_0_losses int”,”‘0′”
“STAR_0_disconnects int”,”‘0′”
“STAR_1_wins int”,”‘0′”
“STAR_1_losses int”,”‘0′”
“STAR_1_disconnects int”,”‘0′”
“STAR_0_last_game int”,”‘0′”
“STAR_0_last_game_result varchar(128)”,”NULL”
“STAR_1_last_game int”,”‘0′”
“STAR_1_last_game_result varchar(128)”,”NULL”
“STAR_1_rating int”,”‘0′”
“STAR_1_high_rating int”,”‘0′”
“STAR_1_rank int”,”‘0′”
“STAR_1_high_rank int”,”‘0′”
“SEXP_0_wins int”,”‘0′”
“SEXP_0_losses int”,”‘0′”
“SEXP_0_disconnects int”,”‘0′”
“SEXP_1_wins int”,”‘0′”
“SEXP_1_losses int”,”‘0′”
“SEXP_1_disconnects int”,”‘0′”
“SEXP_0_last_game int”,”‘0′”
“SEXP_0_last_game_result varchar(128)”,”NULL”
“SEXP_1_last_game int”,”‘0′”
“SEXP_1_last_game_result varchar(128)”,”NULL”
“SEXP_1_rating int”,”‘0′”
“SEXP_1_high_rating int”,”‘0′”
“SEXP_1_rank int”,”‘0′”
“SEXP_1_high_rank int”,”‘0′”
[${prefix}clan]
“cid int NOT NULL PRIMARY KEY”,”‘0′”
“short int”,”‘0′”
“name varchar(32)”,”NULL”
“motd varchar(255)”,”NULL”,
“creation_time int”,”‘0′”
[${prefix}clanmember]
“uid int NOT NULL PRIMARY KEY”,”‘0′”
“cid int”,”‘0′”
“status int”,”‘0′”
“join_time int”,”‘0′”
[${prefix}arrangedteam]
“teamid int NOT NULL PRIMARY KEY”,”‘0′”
“size int”,”0″
“clienttag varchar(8)”,”NULL”
“lastgame int”,”‘0′”
“member1 int”,”‘0′”
“member2 int”,”‘0′”
“member3 int”,”‘0′”
“member4 int”,”‘0′”
“wins int”,”‘0′”
“losses int”,”‘0′”
“xp int”,”‘0′”
“level int”,”‘0′”
“rank int”,”‘0′”The code above is apparently intended to be rolled out by the PvPGN application, it is not an standalone installable SQL script file..
The link below may give you more information on how to use this file -
http://developer.berlios.de/docman/display_doc.php?docid=546&group_id=2291#sql
-
MySQL Cluster
Posted on May 27th, 2009 No commentsWe are using Mysql 4.11. Is it possible to make a MySQL Cluster in Windows XP machine. If yes then how?
It is not possible to install MySQL 4.11 as a cluster on a Windows XP machine. It is supported from version 5 but I would higly advise you not to install this cluster on a Windows XP machine as a production environment.
Windows XP is not meant to be used as a server and also will not work as good as in this area as WIndows Server 2003.Next to the fact that Windows XP is not a server os you need specific hardware for a cluster. Maybe you should also read the FAQ from MySQL about clusters: http://dev.mysql.com/doc/refman/5.0/fr/mysql-cluster-faq.html
I advise you to read the following article:
http://www.onlamp.com/pub/a/onlamp/2006/04/20/advanced-mysql-replication.htm -
How to use get last inserted ID for multiple table?
Posted on May 27th, 2009 No commentsHi,
How do get the last inserted ID from m_menu_1 to be inserted (as menu_info_id) to m_menu_2 and m_menu_3?The code below, only m_menu_2 is getting the last inserted ID from m_menu_1. Whereas m_menu_3 is getting the last inserted ID from m_menu_2.
Please advise.
SQL below
==================
INSERT INTO m_menu_1(title, summary, details, created_by, created_date ) VALUES(strTitle, strSummary, strDetails, strUsername, NOW());
INSERT INTO m_menu_2(menu_info_id, filename, created_by, created_date) VALUES(LAST_INSERT_ID(), strFilename, strUsername, NOW());
INSERT INTO m_menu_3(menu_info_id, video_url, created_by, created_date) VALUES(LAST_INSERT_ID(), strVideoUrl, strUsername, NOW());Try this,.,.
INSERT INTO m_menu_1(title, summary, details, created_by, created_date ) VALUES(strTitle, strSummary, strDetails, strUsername, NOW());
SET @code = LAST_INSERT_ID();
INSERT INTO m_menu_2(menu_info_id, filename, created_by, created_date) VALUES(@code, strFilename, strUsername, NOW());
INSERT INTO m_menu_3(menu_info_id, video_url, created_by, created_date) VALUES(@code, strVideoUrl, strUsername, NOW()); -
MySQL Management Development tools
Posted on May 27th, 2009 No commentsI am looking for a tool, software, platform or solution to help with MySQL development in the first place and management as well and I would like to hear some suggestions. Something equivalent with Management Studio or Enterprise Manager/Query Analyzer for MS-SQL. It doesn’t matter if is free or not as long you thing is the best tool outhere.
Thanks.
That is also a good tool.. my old company ppl used that and they had very good opinion about that… to be honest I never had chance to use it…
See there are lots of tools available in market and some one loves something…but at the end its you who has to decide(not just decide that should give you a comfort zone when you actually gets hands on it).. Better I suggest you to try the trial version of each of these.. and surely you will get an idea like which one is good for your environment..
SQLYog
EMS SQL
Navicat -
SUM in WHERE clause
Posted on May 27th, 2009 No commentsI am having some trouble with a query. Using MySQL 5.
2 tables. HEDGE, HEDGE_CLOSED
The hedge table keeps track of opening hedge positions and the hedge_closed table keeps track of the closing hedge positions on a hedge contract number.
With this query, I am trying to find the hedge_contract_numbers of hedges in the hedge table that have not been closed out in the hedge_closed table.
I need to compare hedge.hedge_contract_count to make sure it’s not equal to SUM(hedge_closed.hedge_closed_contracts). If they are equal, that would mean the positions are closed. I am only looking for open positions.
Code Snippet:1:
2:
3:
4:
5:
6:
7:SELECT DISTINCT(hedge.hedge_contract_number) as hedge_contract_number
FROM hedge LEFT JOIN hedge_closed ON hedge.hedge_contract_number = hedge_closed.hedge_closed_hedge_number
WHERE hedge.hedge_contract_count != SUM(hedge_closed.hedge_closed_contracts)
GROUP BY hedge_contract_numberSELECT h.hedge_contract_number, SUM(h.hedge_contract_count) as h_count,
SUM(IF(hedge_closed_contracts IS NULL,0,hedge_closed_contracts )) as hc_count
FROM hedge h
LEFT JOIN hedge_closed hc
ON h.hedge_contract_number = hc.hedge_closed_hedge_number
GROUP BY h.hedge_contract_number, h.lot_id
HAVING h_count hc_count
Not what you’re looking for? Ask an Expert.SELECT x.hedge_contract_number, SUM(x.hedge_contract_count) as h_count,
SUM(IF(x.hedge_closed_contracts IS NULL,0,x.hedge_closed_contracts )) as hc_count
FROM
(SELECT DISTINCT h.hedge_contract_number, h.hedge_contract_count, hedge_closed_contracts
FROM hedge h
LEFT JOIN hedge_closed hc
ON h.hedge_contract_number = hc.hedge_closed_hedge_number ) x
GROUP BY x.hedge_contract_number
HAVING h_count hc_count




Recent Comments