• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Problem with acc manager?

JayBeee

Retired Global Mod
Senator
Joined
Jun 2, 2007
Messages
5,224
Reaction score
13
Location
Sweden
When I create a character with acc manager and then try to change the account number in the database, I get this error:
#1451 - Cannot delete or update a parent row: a foreign key constraint fails (`RL/players`, CONSTRAINT `players_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE)

Is it something that's wrong with the database or the account manager? o_O I've got no idea.
 
It's the database.

The field "id" in the "accounts" table is directly linked to the field "account_id" in the "players" table, I think that there is no way to change.
 
Try to make again the database if you don't lose too much, I mean if you don't have the ot online. I had such errors once, and I droped my database and downloaded again theforgottenserver.sql and worked fine.
 
You cannot change the account number of a player to an account that doesn't exist. Make sure that the account exists first.
 
just create a new "account" first, like a dublication of the other acc.
Then change the acc number (and the acc id ofc).
Now you will be able to change the account id from "players" for the new acc.

Then, you can delete the old acc.
 
if you are doing mysql from the command line, just do
Code:
set foreign_key_checks=0;

and then you can update your account number in players/accounts

Code:
UPDATE `players` SET `account_id` = newacc# WHERE `account_id` = oldacc# ;
UPDATE `accounts` SET `id` = newacc# WHERE `id` = oldacc# ;

i think the variables are right, then when you are done put the checks back on

Code:
set foreign_key_checks=1;
 
Back
Top