CerberusLF
New Member
- Joined
- Aug 2, 2007
- Messages
- 16
- Reaction score
- 0
Second Step:
Go to Third Step: In your server's folder... someone can tell me how to locate the .sql??
Last edited:
Second Step:
Go to Third Step: In your server's folder... someone can tell me how to locate the .sql??
Error
There is a chance that you may have found a bug in the SQL parser. Please examine your query closely, and check that the quotes are correct and not mis-matched. Other possible failure causes may be that you are uploading a file with binary outside of a quoted text area. You can also try your query on the MySQL command line interface. The MySQL server error output below, if there is any, may also help you in diagnosing the problem. If you still have problems or if the parser fails where the command line interface succeeds, please reduce your SQL query input to the single query that causes problems, and submit a bug report with the data chunk in the CUT section below:
----BEGIN CUT----
eNrtXW9s28YVP4p21DBD/6WpkqpZGDSOo8Z2JDl2GgdBqjhMYlSWUklO1qKBQ0uMw1oiFZFK7BQF
-- 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):
Code: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:/pathtomysql -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.
Credits: Me and Talaturen
Told you it's a long @$$ code...Man how long does it take to get a responce from ppl who know what's goin' on? :/
you need to use the sources and the forgotten.sql file is located inside there
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:/pathtomysql -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 you think, maybe..You could make this a little more clearer. I mean..Step5, "If you're using Windows then open cmd and cd to your directory with mysql.exe" Does that mean to RUN the CMD and type in the path to MYSQL.exe? cuz that didn't do anythin'.. Some specefics would be GREATLY apreciated.... Tnx
C:\xampp\mysql\bin\mysql.exe -u root theforgottenserver -p < theforgottenserver.sql
C:\xampp\mysql\bin\mysql.exe -u root theforgottenserver -p < theforgottenserver.sql
C:\xampp\mysql\bin\mysql.exe -u root otserv -p < forgottenserver.sql
ERROR 1050 (42S01) at line 166: Table 'player_deaths' already exists
SQL query:
DROP TRIGGER IF EXISTS `oncreate_players`
try doing this
cd C:\xampp\mysql\bin\
then do this
mysql.exe -u root theforgottenserver -p < forgottenserver.sql
then you should be asked for your password
C:\xampp\mysql\bin\mysql.exe -u root databasename -p < forgottenserver.sql