• Happy holidays, folks! Thanks to each and every one of you for being part of the Tom's Hardware community!

Question MYSQL - Insert multiple strings of data in a particular way

Ironarmygeneral

Distinguished
Jan 21, 2015
309
2
18,815
Hi guys.

So, I'm an admin in a gaming community, and we recently started to setup a Minecraft server.

Because it runs on Bungeecord, so there are technically multiple server instances--and they all need the same permissions set--(I use LuckPerms BTW)--I've configured all of our servers to have LuckPerms save/edit/write/delete permissions, groups, and tracks from a MYSQL database.

It all works good. However, it's tedious to type the same command to add a permission for EACH PERMISSION, FOR EACH GROUP (though it is nice because there are inheritances, so I don't have to copy ALL permissions for each group/rank).

I've been trying to just use the SQL command line on phpmyadmin to insert numerous permissions at once. The problem is, I can't just use: INSERT INTO (PermGroup/table) (COLUMN permission) VALUES ('perm1', 'perm2', 'perm3', 'etc');

The reason being, the permissions for each permission group is actually stored in a different table called "luckpermsgroup_permissions" with the columns: id, name, permission, value, etc etc.

What would be the best way (if possible) to insert numerous values into the luckpermsgroup_permissions TABLE, but make sure that for each VALUE that I insert into the COLUMN "permission" also assigns that permission of the column NAME "moderator" for example?

I'm not sure of a better way to word any of that, but I'm hoping the images here will help.

Images from Imgur to show the relevant information of my database structure