This guide explains how to grant yourself administrator permissions by directly modifying the database using HeidiSQL. This method is useful when server.cfg configuration isn't working or when you need database-level admin access.

Prerequisites

- Access to your FiveM server's MySQL/MariaDB database
- HeidiSQL installed and configured
- Your database connection details

Step 1: Connect to HeidiSQL

1. Open HeidiSQL on your computer
2. Log in using your database credentials
3. If you need help with the connection setup, refer to our [MySQL HeidiSQL Connection Guide]
4. Wait for the connection to establish successfully

Step 2: Navigate to Users Table

1. In the left sidebar, expand your database
2. Look for a table named "users" or "user_accounts"
3. Double-click on the users table to open it
4. You should see a list of all registered users

Step 3: Find Your User Account

1. Double-click on your user row in the table to select it
2. Locate your user by looking for:
- Your Steam ID (steam:110000xxxxxxxxx)
- Your character name
- Your license identifier
3. Click directly on the cell you want to edit (permission_level)
4. The cell will become editable and you can modify the value

Step 4: Update User Permissions

Set Permission Level
1. Find the "permission_level" column
2. Change the value to the appropriate admin level:
- `0` = Regular user (no admin privileges)
- `1-3` = Admin levels (you can assign different permissions within admin)
- `4` = Superadmin (full access)
3. If the column doesn't exist, look for similar fields like:
- `admin_level`
- `user_level`
- `rank`

Step 5: Update Admin Group

1. Find the "group" column
2. Change the value to the appropriate admin group:
- `user` = Regular player with no admin privileges
- `admin` = Basic administrative permissions
- `superadmin` = Full permissions, including management of other admins

Step 6: Save Changes

1. Click "Save" or press Ctrl+S
2. Alternatively, click "Apply" to commit the changes
3. Wait for the confirmation message
4. Verifythat your changes were saved successfully

Step 7: Test Admin Access

Important: Make sure the player is disconnected from the server before making database changes. If the player is online when you modify their permissions, they may overwrite your changes when they disconnect.

1. Close HeidiSQL when finished
2. Ensure the player reconnects to the server for changes to take effect
3. Join your server and test admin commands:
- Press home button (Mostly use for es_admin2)
- `/noclip` - Toggle no-clip mode
- `/god` - Toggle god mode
- `/heal` - Heal yourself
- `/car adder` - Spawn a vehicle

Note: Server restart is not required for database permission changes to take effect.

Troubleshooting

Can't Find Users Table?
- Check for tables named: `players`, `accounts`, `characters`
- Look in different databases if you have multiple
- Verify you're connected to the correct database

Changes Not Taking Effect?
- Restart the server completely
- Clear cache if your framework uses caching
- Check server logs for database errors
- Verify column names match your framework

Permission Levels Not Working?
- Different frameworks use different permission systems
- Check your framework's documentation for correct values
- Some frameworks require additional database entries

Database Connection Issues?
- Verify your connection credentials
- Check if the database server is running
- Contact your hosting provider if needed

Security Warnings

Important Security Notes:
- Backup your database before making changes
- Only modify your own account unless necessary
- Use strong passwords for database access
- Limit database access to trusted individuals
- Monitor admin accounts regularly for security

Need Help?

If you're having trouble with database admin setup:
1. Check framework documentation for specific table structures
2. Review server logs for database connection errors
3. Test with a development server first
5. Join your framework's community for additional help

Click the Live Support button on our homepage to get help instantly

Was this answer helpful? 28 Users Found This Useful (107 Votes)