• 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!

Help..

Yony

New Member
Joined
Sep 7, 2007
Messages
318
Reaction score
0
Location
Israel
When I'm trying to import triggers (I use newer phpmyadmin like you said in other tuts)
It's write me this error :
Import has been successfully finished, 10 queries executed.
SQL query:


DROP TRIGGER IF EXISTS `oncreate_players`;# MySQL returned an empty result set (i.e. zero rows).

DROP TRIGGER IF EXISTS `oncreate_guilds`;# MySQL returned an empty result set (i.e. zero rows).

DROP TRIGGER IF EXISTS `ondelete_players`;# MySQL returned an empty result set (i.e. zero rows).

DROP TRIGGER IF EXISTS `ondelete_guilds`;# MySQL returned an empty result set (i.e. zero rows).

DROP TRIGGER IF EXISTS `ondelete_accounts`;# MySQL returned an empty result set (i.e. zero rows).

DELIMITER |

CREATE TRIGGER `ondelete_accounts`
BEFORE DELETE
ON `accounts`
FOR EACH ROW
BEGIN
DELETE FROM `bans` WHERE `account` = OLD.`id`;
END|# MySQL returned an empty result set (i.e. zero rows).


CREATE TRIGGER `ondelete_guilds`
BEFORE DELETE
ON `guilds`
FOR EACH ROW
BEGIN
UPDATE `players` SET `guildnick` = '', `rank_id` = 0[...]


tell me whats wrong... it worked for me before ( 1 week ago) and i didn't change nothing since then...
 
I got the same problem!!!
I cant import triggers, i tried all the tutorials, can some1 explain it to me?? quick
 
Read this, it's from a tutorial that came with 0.2.2 and the commands are good to know for other things too.

TheForgottenServer is now using triggers since version 0.2.2, if you want your players
to still be able to gain skills etc, please continue reading!

-- NOTE: IMPORTING TRIGGERS.SQL USING PHPMYADMIN WON'T WORK SO THERE'S NO NEED TO TRY THAT.

1. Create a file, lets call it triggers.sql.
-- NOTE: THERE IS ALREADY A TRIGGERS.SQL IN THE SAME DIRECTORY AS THIS FILE, YOU CAN USE IT IF YOU WANT AND JUMP TO STEP 5.
2. Open it.
3. Paste this inside it (note; change skills part if you dont want players to start with 10 in all skills):

DROP TRIGGER IF EXISTS `oncreate_players`;
DROP TRIGGER IF EXISTS `oncreate_guilds`;
DROP TRIGGER IF EXISTS `ondelete_players`;
DROP TRIGGER IF EXISTS `ondelete_guilds`;
DROP TRIGGER IF EXISTS `ondelete_accounts`;
DELIMITER |

CREATE TRIGGER `ondelete_accounts`
BEFORE DELETE
ON `accounts`
FOR EACH ROW
BEGIN
DELETE FROM `bans` WHERE `account` = OLD.`id`;
END|

CREATE TRIGGER `ondelete_guilds`
BEFORE DELETE
ON `guilds`
FOR EACH ROW
BEGIN
UPDATE `players` SET `guildnick` = '', `rank_id` = 0 WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = OLD.`id`);
END|

CREATE TRIGGER `ondelete_players`
BEFORE DELETE
ON `players`
FOR EACH ROW
BEGIN
DELETE FROM `bans` WHERE `type` = 2 AND `player` = OLD.`id`;
UPDATE `houses` SET `owner` = 0 WHERE `owner` = OLD.`id`;
END|

CREATE TRIGGER `oncreate_guilds`
AFTER INSERT
ON `guilds`
FOR EACH ROW
BEGIN
INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('the Leader', 3, NEW.`id`);
INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('a Vice-Leader', 2, NEW.`id`);
INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('a Member', 1, NEW.`id`);
END|

CREATE TRIGGER `oncreate_players`
AFTER INSERT
ON `players`
FOR EACH ROW
BEGIN
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 0, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 1, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 2, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 3, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 4, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 5, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 6, 10);
END|

DELIMITER ;

4. Save the file and close it.
5. If you're using Windows then open cmd and cd to your directory with mysql.exe, if you're using Linux
then launch a terminal.
6. Linux users type: mysql -u yourUserName yourDatabaseName -p < triggers.sql
Example: mysql -u root theforgottenserver -p < triggers.sql

Windows users type: pathToMySQL -u yourUserName yourDatabaseName -p < triggers.sql
Example: C:\path\to\mysql -u root theforgottenserver -p < triggers.sql

Note: You must be in the directory there triggers.sql is, to change directory use the command 'cd path'.

7. You will now be asked to type in your password for the user you picked, do it.
8. If there's no output when you done that, you're done, you can close this file, if you got any error read on.

-- DO NOT POST YOUR ERROR IN THEFORGOTTENSERVER THREAD, POST IT HERE: http://******.net/showthread.php?t=82079!
-- IF THERE'S SOMETHING YOU DON'T UNDERSTAND ALSO READ: http://******.net/showthread.php?t=82079!
 
now when i'm trying import the triggers you wrote here it says this problem:


SQL query:

DELIMITER;



MySQL said:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER' at line 1


and when I'm trying to use commandline it says:
The system cannot find the file specified.

Please tell me what to do..
I worked hard on my server and I want to open it :\
 
Read the whole thing before you try it again... -.-

Open the command console, write cd[path to to your server] and then
write "C:\xampp\mysql\bin\mysql.exe -u root theforgottenserver -p < forgottenserver.sql" (without "")
 
Last edited:
Tried what you wrote and still it's write the same thing
 
Just use the lastest xampp, and import the .sql.

or just use a webserver that contains phpMyAdmin > 2.11.0
 
Last edited:
Im using phpmuadmin 2.11.1-rc or so...
So whats the problem?!?
 
I also tried to do what u wrote Empty and i got same problem as Lolipop's
 
I alreadu imported theforgottenserver.sql through the phpadmin website thing, but i cant import the triggers.sql
i tried 100 times every existed tutrial but it cant find the path~
can some1 explain it to me, where to put w/e exactly?
to copy paste the triggers.sql to c:/xampplite/mysql/bin?
 
Back
Top