This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

SQL Admin Plugins, Voting


Post New Thread Closed Thread   
 
Thread Tools Display Modes
imported_Anth0ny
Senior Member
Join Date: Jan 2005
Location: Saturn
Old 08-23-2007 , 10:25   Re: SQL Admin Plugins, Voting
#21

... and will be useful command sm_sql_listadmins (with SQl support) for "who admins now" checking =)
__________________
aka Mad.Eagle
Creator\Owner\Admin of
www.megatron.ws
imported_Anth0ny is offline
Send a message via ICQ to imported_Anth0ny
Solltex
Member
Join Date: Dec 2004
Old 08-23-2007 , 15:00   Re: SQL Admin Plugins, Voting
#22

[sql-admin-manager.smx] Could not connect to database: [2002]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

where find problem?
Solltex is offline
^BuGs^
Senior Member
Join Date: May 2007
Old 08-23-2007 , 15:02   Re: SQL Admin Plugins, Voting
#23

Quote:
Originally Posted by imported_Anth0ny View Post
... and will be useful command sm_sql_listadmins (with SQl support) for "who admins now" checking =)
I have coded this and awaiting BAILOPAN approval.
__________________
Sourcemod Plugin Author and Plugin Approver
"The correct way is MAXPLAYERS + 1"
I will not take bugs/new idea reports over the forums. Please use the issue list.
^BuGs^ is offline
BAILOPAN
Join Date: Jan 2004
Old 08-23-2007 , 20:28   Re: SQL Admin Plugins, Voting
#24

Solltex: What did you put for the hostname?
__________________
egg
BAILOPAN is offline
[Arnold]
Senior Member
Join Date: May 2004
Old 08-24-2007 , 02:35   Re: SQL Admin Plugins, Voting
#25

Quote:
Originally Posted by Solltex View Post
[sql-admin-manager.smx] Could not connect to database: [2002]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

where find problem?
Using a recent Debian based Linux? If that's true try to set up a symlink to where the mysqld socket is located here and see if it works:

Code:
ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
Arnold
[Arnold] is offline
Solltex
Member
Join Date: Dec 2004
Old 08-24-2007 , 11:01   Re: SQL Admin Plugins, Voting
#26

Quote:
Originally Posted by BAILOPAN View Post
Solltex: What did you put for the hostname?
localhost

Quote:
Originally Posted by [Arnold] View Post
Using a recent Debian based Linux? If that's true try to set up a symlink to where the mysqld socket is located here and see if it works:

Code:
ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
Arnold
Linux slackware

root@***:~# ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
ln: `/tmp/mysql.sock': File exists

this ok, but in server console anyway have problem:
08/24/2007 - 23:08:28: [sql-admin-manager.smx] Could not connect to database: [2002]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)


P.S sorry need not mysqld/mysqld.sock , but mysql/mysql.sock. WORKS

Last edited by Solltex; 08-24-2007 at 12:50.
Solltex is offline
BAILOPAN
Join Date: Jan 2004
Old 08-24-2007 , 17:19   Re: SQL Admin Plugins, Voting
#27

Try using 127.0.0.1 instead of localhost

If that doesn't work post a feature request for using a direct socket through the host string.
__________________
egg
BAILOPAN is offline
khap
Junior Member
Join Date: May 2007
Location: Moscow, Russia
Old 08-29-2007 , 09:18   Re: SQL Admin Plugins, Voting
#28

try hostname
Quote:
localhost:/var/run/mysqld/mysqld.sock
__________________
Russian Servers Day Of Defeat: Source - www.polygon4.net
khap is offline
imported_Anth0ny
Senior Member
Join Date: Jan 2005
Location: Saturn
Old 08-29-2007 , 10:15   Re: SQL Admin Plugins, Voting
#29

=)

We offer to chage default mysql codepage for plugin from latin1 to utf8 for native supporting multilanguage.

i hope this code right...

details:

admin-sql-threaded.sp

Code:
public OnRebuildAdminCache(AdminCachePart:part)
{
/* First try to get a database connection */
decl String:error[255];
new Handle:db;
 
if (SQL_CheckConfig("admins"))
{
db = SQL_Connect("admins", true, error, sizeof(error));
} else {
db = SQL_Connect("default", true, error, sizeof(error));
}
 
if (db == INVALID_HANDLE)
{
LogError("Could not connect to database \"default\": %s", error);
return;
}

/* Set codepage to utf8 */
 
decl String:query[255];
Format(query, sizeof(query), "SET NAMES 'utf8'");
if (!SQL_FastQuery(db, query))
{
LogError("Can't select character set (%s)", query);
}

/* End of Set codepage to utf8 */
 
if (part == AdminCache_Overrides)
{
FetchOverrides(db);
} else if (part == AdminCache_Groups) {
FetchGroups(db);
} else if (part == AdminCache_Admins) {
FetchUsers(db);
}
 
CloseHandle(db);
}
sql-admin-manager.sp

Code:
Handle:Connect()
{
decl String:error[255];
new Handle:db;
 
if (SQL_CheckConfig("admins"))
{
db = SQL_Connect("admins", true, error, sizeof(error));
} else {
db = SQL_Connect("default", true, error, sizeof(error));
}
 
if (db == INVALID_HANDLE)
{
LogError("Could not connect to database: %s", error);
}

/* Set codepage to utf8 */
 
decl String:query[255];
Format(query, sizeof(query), "SET NAMES 'utf8'");
if (!SQL_FastQuery(db, query))
{
LogError("Can't select character set (%s)", query);
}

/* End of Set codepage to utf8 */
 
return db;
}
or much better include it to dbi.inc....
__________________
aka Mad.Eagle
Creator\Owner\Admin of
www.megatron.ws
imported_Anth0ny is offline
Send a message via ICQ to imported_Anth0ny
BAILOPAN
Join Date: Jan 2004
Old 08-29-2007 , 17:43   Re: SQL Admin Plugins, Voting
#30

MySQL-specific table properties should go in the mysql setup script.
__________________
egg
BAILOPAN is offline
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode