Jump to content
  • 0
Sign in to follow this  
ToiletMaster

Unable to apply updates SQL

Question

Hi guys,

 

I'm currently converting from rAthena to Hercules.

 

However, my settings are correct and I'm able to connect to my server,

 

but the only challenges I faced was

 

[SQL]: 'sql-files/upgrades/2013-02-14--16-15.sql' wasn't applied to the database[SQL]: 'sql-files/upgrades/2013-03-05--01-05.sql' wasn't applied to the database[SQL]: 'sql-files/upgrades/2013-03-09--01-56.sql' wasn't applied to the database[SQL]: If you did apply these updates or would like to be skip, insert a new entry in your sql_updates table with the timestamp of each file

 

I did update all the files, however I received an error on the files upon updating these 3 files.

 

 

2013-02-14--16-15.sql

 

12:28:01    CREATE TABLE IF NOT EXISTS `sql_updates` (   `timestamp` int(11) unsigned NOT NULL,   `ignored` enum('Yes','No') NOT NULL DEFAULT 'No' ) ENGINE=MyISAM    0 row(s) affected, 1 warning(s): 1050 Table 'sql_updates' already exists    0.000 sec 12:28:01    ALTER TABLE `skill` ADD COLUMN `flag` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0    Error Code: 1060. Duplicate column name 'flag'    0.000 sec

 

2013-03-05--01-05.sql

 

12:29:17    ALTER TABLE  `login` ADD  `character_slots` TINYINT( 3 ) UNSIGNED NOT NULL    Error Code: 1060. Duplicate column name 'character_slots'    0.000 sec

 

2013-03-09--01-56.sql

 

12:29:57    ALTER TABLE `login` ADD COLUMN `pincode` varchar(4) NOT NULL DEFAULT ''    Error Code: 1060. Duplicate column name 'pincode'    0.000 sec

 

Some points to note:

  • I immediately ran updates on my current rAthena SQL DB on this. from the first to latest update.
  • Upon having the error, I thought it wasn't compatible, therefore I made a new schema yet the problem still occurs.

 

 

 

the rest of the updates went fine I believe. I'm not a SQL expert nor literate in SQL Language, therefore if someone could help that'll be great! 

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Did you compile it with Visual C++? If you did I'd suggest running the server in debug mode to figure out the issue and post here with whatever problems you may have if you can't solve them :)

Share this post


Link to post
Share on other sites
  • 0

Each .sql file has an insert into sql_updates entry And inserts a timestamp.  Make sure the sql_updates table has all the timestamp entries as needed. Every now and then I still have to struggle with some of the updates since they seem to be already into the main.sql file. 

 

As you found into errors when running the sql code, the rest of the file didnt go through and the insert into sql_updates is at the bottom. Double check that and add them all manually :) (At least the ones the server is complaining about)

Share this post


Link to post
Share on other sites
  • 0

Each .sql file has an insert into sql_updates entry And inserts a timestamp.  Make sure the sql_updates table has all the timestamp entries as needed. Every now and then I still have to struggle with some of the updates since they seem to be already into the main.sql file. 

 

As you found into errors when running the sql code, the rest of the file didnt go through and the insert into sql_updates is at the bottom. Double check that and add them all manually :) (At least the ones the server is complaining about)

 

Thanks for the reply Xgear!

 

However the only concern right now would be adding them. I do apologize as when it comes to SQL, i'm really a dunce, :wacko:

 

Therefore I do not know whether if everything is there or not ._.

Share this post


Link to post
Share on other sites
  • 0

Open each one of the files its complaining about

 

For instance, we will use

[SQL]: 'sql-files/upgrades/2013-03-09--01-56.sql' wasn't applied to the database

 

This is what the file looks like

 

 

#1362794218ALTER TABLE `login` ADD COLUMN `pincode` varchar(4) NOT NULL DEFAULT '';ALTER TABLE `login` ADD COLUMN `pincode_change` int(11) unsigned NOT NULL DEFAULT '0';INSERT INTO `sql_updates` (`timestamp`) VALUES (1362794218); 

If you notice the first line, it contains a timestamp (1362794218)

And if you notice the last line, it also contains... the same timestamp! (1362794218)

 

The last line runs the INSERT into the database, so basically what you'd do is (Assuming you are using phpMyAdmin), Go to phpMyAdmin -> Go to your RO Database -> Click SQL tab at the top. 

Paste this line: INSERT INTO `sql_updates` (`timestamp`) VALUES (1362794218);

 

That will insert the timestamp and should finish the warning for the file. 

Repeat until done. 

 

Note: There is one file missing the timestamp insert (2013-04-16--01-24.sql), it was added a bit after that, and you'll notice 2013-04-16--02-15.sql has 2 INSERT INTO sql_updates entries (last 2 lines), one is for the previous file and the other one is for the current.

 

Hope that helps you out enough :)

Share this post


Link to post
Share on other sites
  • 0

Open each one of the files its complaining about

 

For instance, we will use

[SQL]: 'sql-files/upgrades/2013-03-09--01-56.sql' wasn't applied to the database

 

This is what the file looks like

 

 

#1362794218ALTER TABLE `login` ADD COLUMN `pincode` varchar(4) NOT NULL DEFAULT '';ALTER TABLE `login` ADD COLUMN `pincode_change` int(11) unsigned NOT NULL DEFAULT '0';INSERT INTO `sql_updates` (`timestamp`) VALUES (1362794218); 

If you notice the first line, it contains a timestamp (1362794218)

And if you notice the last line, it also contains... the same timestamp! (1362794218)

 

The last line runs the INSERT into the database, so basically what you'd do is (Assuming you are using phpMyAdmin), Go to phpMyAdmin -> Go to your RO Database -> Click SQL tab at the top. 

Paste this line: INSERT INTO `sql_updates` (`timestamp`) VALUES (1362794218);

 

That will insert the timestamp and should finish the warning for the file. 

Repeat until done. 

 

Note: There is one file missing the timestamp insert (2013-04-16--01-24.sql), it was added a bit after that, and you'll notice 2013-04-16--02-15.sql has 2 INSERT INTO sql_updates entries (last 2 lines), one is for the previous file and the other one is for the current.

 

Hope that helps you out enough :)

 

Thanks! I get what you mean on this part!

 

Your explanation was simple and very detailed!

 

However, one more small error comes out though ._.

 

I've yet to add anything custom on my side here aside from changing the configurations.

 

It worked previously, but not now though.

 

right now this happens ._.

 

Hello_zps95bcd6f4.png

Share this post


Link to post
Share on other sites
  • 0

Hi there Xgear,

 

thanks for being extremely patient with me.

 

Currently after running the server in debug mode, the server managed to start running! (I'm starting to think you're a miracle xD)

 

Thank you very much for helping me out!

Share this post


Link to post
Share on other sites
  • 0

Well, running in debug mode is meant to help you debug the issue, it doesn't fix the issue (Unless you didnt properly compile the server after a change?)

Share this post


Link to post
Share on other sites
  • 0

Well, running in debug mode is meant to help you debug the issue, it doesn't fix the issue (Unless you didnt properly compile the server after a change?)

To be honest, there weren't any issues that came out, but after using the debug mode. It magically fixed!

 

I din't changed any files yet lol.

 

Try with a clean emulator in Release mode..

 

I did, i downloaded hercules and have yet to place any files aside from the configurations to make my server work. however that happened unexpectedly ._.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.