How to manage guilds and alliances through the database in MU Online
Learn to administer guilds, ranks, members and alliances directly through your MU Online server's database tables, with safe SQL and good backup practices.
Managing guilds and alliances directly through the database is one of the most delicate tasks in administering a MU Online server. The game interface covers the players' day-to-day, but when you need to transfer the leadership of an abandoned guild, recover a guild deleted by mistake, fix a corrupte
Managing guilds and alliances directly through the database is one of the most delicate tasks in administering a MU Online server. The game interface covers the players' day-to-day, but when you need to transfer the leadership of an abandoned guild, recover a guild deleted by mistake, fix a corrupted mark or dissolve an alliance that's blocking the Guild War, the path is SQL. This tutorial shows, step by step, how to identify the right tables, write safe queries and avoid the mistakes that permanently corrupt guild data.
The central point you need to understand right away: guilds don't live in a single table. There is the guild table (name, master, mark, notice), the member table (linking each character to the guild and its rank), and often an alliance table that links guilds to each other. Touching one without considering the others is the number one cause of "ghost" guilds that appear in the list but don't load. All table and column names here are common examples — the exact naming varies by season/emulator (IGCN, MuEmu, classic Season 6, X-Files, etc.), so always confirm your server's real schema before running any command.
Prerequisites
Before you touch any guild table, make sure you have the minimum environment and knowledge below:
- Administrative access to SQL Server (SSMS - SQL Server Management Studio) with the
salogin or a user with write permission on the game database, usually namedMuOnline. - A full, recent backup of the database. Never run UPDATE or DELETE in production without a
.bakmade minutes before. - A maintenance window or a low-traffic time. The GameServer keeps guilds in cache; editing with many players online creates inconsistency.
- Knowledge of your emulator's schema. Open SSMS, expand the
MuOnlinedatabase and locate the guild tables before you begin. - A test environment (local server or VM) to validate each query before applying it in production. This is not optional in advanced operations.
- Basic familiarity with SQL (SELECT, UPDATE, DELETE, JOIN, transactions). If you haven't set up your server yet, start with the how to create a MU Online server guide before administering guilds.
Understanding the guild tables
The guild data model in MU Online follows a well-defined relational structure. Knowing the role of each table is what separates a safe edit from a disaster. Here's the typical mapping (example names, they vary by season/emulator):
| Table (example) | Function | Typical key columns |
|---|---|---|
Guild | Guild record | G_Name, G_Master, G_Score, G_Mark, G_Notice |
GuildMember | Links characters to the guild | Name, G_Name, G_Level (rank), G_Status |
GuildMatching / G_Alliance | Alliance and hostility links | G_Name, Number, Type |
The rank field (here called G_Level) usually uses numeric codes. A very common scheme is: 0 for a regular member, 32 for Battle Master (deputy), 128 for the guild master. Some emulators also use 48 for an assistant. Again: confirm the values in your emulator, since they change between versions.
The essential relationship is: each row in GuildMember points to a guild in Guild by name (G_Name) and to a character by the Name column. Meanwhile the Character table (of the characters) often has its own field indicating the current guild. Keeping these three points in sync is the foundation of everything.
Querying guilds and members
Before changing anything, always inspect. Start by listing the active guilds and the member count to understand the scene:
-- Lists guilds with member count (example names)
SELECT g.G_Name,
g.G_Master,
g.G_Score,
COUNT(m.Name) AS Members
FROM Guild g
LEFT JOIN GuildMember m ON g.G_Name = m.G_Name
GROUP BY g.G_Name, g.G_Master, g.G_Score
ORDER BY Members DESC;
To investigate a specific guild and see all its members with their ranks:
SELECT m.Name,
m.G_Level AS Rank,
m.G_Status
FROM GuildMember m
WHERE m.G_Name = 'GuildName'
ORDER BY m.G_Level DESC;
The member with the highest rank value (for example 128) should match the G_Master field of the Guild table. If it doesn't match, you've found an inconsistent guild that needs correction.
Transferring a guild's leadership
This is the most common case: the master stopped playing and the guild is stuck. The transfer requires two coordinated updates — changing the master in the Guild table and adjusting the new leader's rank in GuildMember. Always do it inside a transaction:
BEGIN TRANSACTION;
-- 1. Demote the old master to a regular member
UPDATE GuildMember
SET G_Level = 0
WHERE G_Name = 'GuildName' AND Name = 'OldMaster';
-- 2. Promote the new leader to the master rank
UPDATE GuildMember
SET G_Level = 128
WHERE G_Name = 'GuildName' AND Name = 'NewMaster';
-- 3. Update the master field in the guild table
UPDATE Guild
SET G_Master = 'NewMaster'
WHERE G_Name = 'GuildName';
-- Check the result before confirming
SELECT G_Name, G_Master FROM Guild WHERE G_Name = 'GuildName';
COMMIT TRANSACTION;
-- If something is wrong, use ROLLBACK TRANSACTION instead of COMMIT
Numbered steps to execute safely:
- Back up the database.
- Confirm that
NewMasteractually belongs to the guild (run the member SELECT). - Execute the block inside
BEGIN TRANSACTION. - Run the verification SELECT before the
COMMIT. - Restart the GameServer or ask the members to relog so the cache updates.
Removing members and orphaned guilds
To remove an individual member, delete the row in GuildMember and clear the link on the character, if your emulator stores the guild in the Character table:
DELETE FROM GuildMember
WHERE G_Name = 'GuildName' AND Name = 'LeavingMember';
To dissolve an entire guild, order matters. Remove the members first, then the alliances, and only then the guild, avoiding dangling records:
BEGIN TRANSACTION;
DELETE FROM GuildMember WHERE G_Name = 'DeadGuild';
DELETE FROM GuildMatching WHERE G_Name = 'DeadGuild';
DELETE FROM Guild WHERE G_Name = 'DeadGuild';
COMMIT TRANSACTION;
Never delete the Guild row while leaving members in GuildMember. That creates characters that "think" they're in a nonexistent guild, which freezes the guild panel in the client.
Managing alliances
Alliances link two or more guilds under a leader guild. In the typical model, there's a dedicated table where each row links the alliance's leader guild to a member guild, plus a type field that distinguishes alliance from hostility (declared Guild War). Example structure:
| Field (example) | Meaning |
|---|---|
G_Name | The alliance's leader guild |
Number | Member/allied guild |
Type | 0 = alliance, 1 = hostility |
To create an alliance manually, insert the link pointing the leader guild to the ally:
INSERT INTO GuildMatching (G_Name, Number, Type)
VALUES ('LeaderGuild', 'AllyGuild', 0);
To dissolve a problematic alliance that's blocking the Guild War or preventing a guild from joining another alliance:
DELETE FROM GuildMatching
WHERE (G_Name = 'LeaderGuild' AND Number = 'AllyGuild')
OR (G_Name = 'AllyGuild' AND Number = 'LeaderGuild');
Remember that many emulators limit the number of guilds per alliance (usually 5). Forcing more rows than the limit can cause unpredictable behavior in the client.
Fixing the guild mark (logo)
The guild mark is stored as a fixed-size binary field (G_Mark), usually 32 bytes, representing the 16x16 pixel drawing. A corrupted mark makes the guild disappear from the list or the client crash when rendering it. To zero out a faulty mark and force the player to redraw it:
UPDATE Guild
SET G_Mark = 0x0000000000000000000000000000000000000000000000000000000000000000
WHERE G_Name = 'GuildName';
The exact binary size varies by emulator. Confirm with SELECT DATALENGTH(G_Mark) FROM Guild how many bytes the field expects before overwriting.
Syncing the GameServer cache
The most frequent conceptual error of beginner administrators is editing the database and expecting the game to change instantly. The GameServer loads guilds and alliances into memory, usually at startup, and writes them back to the database periodically or when events occur. This means two things:
- Your changes can be overwritten by the server if a member of that guild is online and the server writes the old state over yours.
- Your changes only appear after the cache is reloaded.
The safe practice: make guild edits with the GameServer shut down or in maintenance, and start it afterward. That way the server reads the already-corrected state directly from the database.
Common errors and fixes
| Error | Likely cause | Fix |
|---|---|---|
| Guild appears in the list but doesn't load members | Guild exists with no rows in GuildMember | Re-register the members or delete the orphaned guild |
| Master can't kick/invite | G_Master diverges from rank 128 in GuildMember | Sync the two fields with the leadership-transfer block |
| Changes disappear after a restart | GameServer overwrote with the old cache | Edit with the server in maintenance and restart afterward |
| Client crashes when opening the guild panel | Mark (G_Mark) with invalid size/binary | Zero out the G_Mark field with the correct size |
| Guild War won't start | Duplicate or orphaned hostility record in alliances | Clean up the inconsistent rows in the alliance table |
| Character "stuck" in a deleted guild | Residual link in the Character table | Update/clear the guild field on the character |
Launch checklist
Before considering a guild operation complete in production, go through this list:
- Full backup of the
MuOnlinedatabase made and verified - Real schema of the guild tables confirmed on your emulator
- Query tested in a local environment before production
- Operation executed inside
BEGIN TRANSACTION - Verification SELECT run before the
COMMIT G_Masterfield synced with the rank inGuildMember- No orphaned rows in
GuildMemberor the alliance table - GameServer restarted or cache reloaded after the edits
- Affected members told to relog
- Record of the change noted in your administration log
Managing guilds through the database gives you control the game interface never offers, but it demands discipline in return. Treat each table as part of a related set, never edit in production without a backup, and always respect the GameServer cache. With these practices, you resolve everything from abandoned guilds to corrupted alliances without risking your server's integrity.
Frequently asked questions
Can I edit guilds while the server is online?
Yes, but the GameServer keeps guild data in cache. Direct changes in the database only appear reliably after the member relogs or after the GameServer restarts. For critical operations, prefer scheduling maintenance.
What happens if I delete a guild's master?
The guild is orphaned and can cause an error when loading the member list. Always transfer leadership to another character before removing the master, updating the master field and the new leader's rank.
How do I force the in-game guild list to refresh?
Restart the GameServer or use your emulator's reload command, when one exists. Many emulators load guilds at startup and keep them in memory for the entire session.
Which table holds alliances?
It depends on the emulator. In many, there is a dedicated alliance table (for example GuildMatching or G_Alliance) that links the alliance's leader guild to the member guilds. Confirm your emulator's schema before editing.
Do I need a backup for these operations?
Yes, always. Guilds involve multiple related tables (guild, members, mark/logo, alliances). A full backup before any UPDATE or DELETE is mandatory in production.