you have to do it over the server console and tipe /op name or alternative you go into the ops.json and write something like
[
{
"uuid": "026b8796-f96c-3409-8fbc-c7b359c522e9",
"name": "namex",
"level": 4
},
{
"uuid": "e10138dc-3a17-3162-a5c7-6257053c3b0c",
"name": "Inngrimsch",
"level": 4
}
]
the uuid is the same as your playerdat(inventory)