cmangos / issues

This repository is used as a centralized point for all issues regarding CMaNGOS.
179 stars 47 forks source link

💬 [Support Request] #2620

Closed Zaloste closed 2 years ago

Zaloste commented 2 years ago

Core Version

mangos-tbc

Support Request Details

Hey guys! How are you?

I'm having a little problem when running "./InstallFullDB.sh" on TBC, in the folder "mangos-tbc\sql\updates\mangos" has the .sql file "s2441_01_mangos_waypoint_path" I'm getting the error "ERROR 1064 (42000) at line 3: 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 'COLUMN SpawnGroupID TO Id' at line 1"

I did everything as per the following tutorial: https://github.com/cmangos/issues/wiki/Detailed-installation-guide-for-Microsoft-Windows

And I only had problems in that part, I noticed that the file was recently modified by the developers about 3 hours ago.

I believe it's a syntax error, maybe because of my MySql version or something like that. I'm using version 5.7, and I recently downloaded the files from github. Can anyone help me?

Steps to Reproduce

1."Git BASH Here" on tbc-db-master folder 2.typed "./InstallFullDB.sh" and pressed "enter" 3. 4.

Crash Log

Trying to apply additional core updates from path ../mangos-tbc ... Appending core update s2441_01_mangos_waypoint_path.sql to database tbcmangos ERROR 1064 (42000) at line 3: 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 'COLUMN SpawnGroupID TO Id' at line 1 ERROR: cannot apply ../mangos-tbc/sql/updates/mangos/s2441_01_mangos_waypoint_path.sql

Core SHA1 Commit Hash

718e4537a1854baad60fec6a8a26399dece078ec

Database SHA1 Commit Hash

Didn't find this

Server Operating System

Windows 10

Client Version

2.4.3 (The Burning Crusade)

Client Operating System

World of Warcraft TBC 2.4.3

killerwife commented 2 years ago

Pull https://github.com/cmangos/mangos-tbc/commit/46e6c31ff7695dfc60cb552b7fbedb4b0ec3bb08

Zaloste commented 2 years ago

Now i got this:

Trying to apply ../mangos-tbc/sql/scriptdev2 ... Appending SD2 file update scriptdev2.sql to database tbcmangos ERROR 1054 (42S22) at line 5392: Unknown column 'Point' in 'field list' ERROR: cannot apply ../mangos-tbc/sql/scriptdev2/scriptdev2.sql

It is exactly on the line that we change. Am I doing something wrong? Most likely :')

cyberium commented 2 years ago

Is your core_path correctly set in InstallFullDB.config? Be sure

If iam not wrong your error is due to missing core update before trying to install scriptdev2.sql

Zaloste commented 2 years ago

I decided to redo everything from 0, as as Cyberium mentioned I may have done something wrong in the process. Strangely now I'm having problems when creating the databases in MySQL Workbench, here are the steps I took:

  1. I deleted all files and folders.
  2. I created a folder at the root of C:\ called "mangos", thus getting: "C:\mangos"
  3. I accessed the folder and used "Git Bash Here" and entered the following commands.
    git clone https://github.com/cmangos/mangos-tbc.git
    git clone https://github.com/cmangos/tbc-db.git
  4. I opened CMake and made the settings as the tutorial teaches and went to VisualStudio
  5. I compiled the code in Release x64 version and didn't get any errors.
  6. I opened MySQL Workbench and created the database from the file: "db_create_mysql.sql" found in the folder "C:\mangos\mangos-tbc\sql\create"
  7. I started the data insertion process from the .sql files found in: "C:\mangos\mangos-tbc\sql\base" / characters.sql, logs.sql, mangos.sql and realmd.sql
  8. But now, different from before, I had an error in the mangos.sql file when tried to execute him on MySQL Workbench:

Table: "spawn_group_formation" Error Code: 1072. Key column 'SpawnGroupID' doesn't exist in table

Sorry for the long comment, but I wanted it to be as clear as possible for you to help me :)

cyberium commented 2 years ago

Pull last version of the core i forgot to change primary key so my bad about that error

You can just go to mangos-tbc folder and type git pull or git pull origin master to get last change

Zaloste commented 2 years ago

I got the same error as before. :(

Trying to retrieve last core update packaged in database ...
Found last core revision in DB is 2440

Trying to apply additional core updates from path ../mangos-tbc ...
Appending core update s2441_01_mangos_waypoint_path.sql to database tbcmangos
ERROR 1064 (42000) at line 3: 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 'COLUMN `SpawnGroupID` TO `Id`' at line 1
ERROR: cannot apply ../mangos-tbc/sql/updates/mangos/s2441_01_mangos_waypoint_path.sql

After you report the error I redid the steps from 0 again.

Mangos-tbc updated!

MINGW64 /c/mangos/mangos-tbc (master)
$ git pull
Already up to date.

Tbc-db updated!

MINGW64 /c/mangos/tbc-db (master)
$ git pull
Already up to date.

My CORE-PATH: CORE_PATH="../mangos-tbc"

adellaci commented 2 years ago

I just did a pull and ran ./InstallFullDB.sh on a Linux system. I got no errors, that was for TBC & WoTLK. I have not done classic yet because i want to try Cyberium's new script

MantisLord commented 2 years ago
ERROR 1064 (42000) at line 3: 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 'COLUMN `SpawnGroupID` TO `Id`' at line 1

https://popsql.com/learn-sql/mysql/how-to-rename-a-column-in-mysql#mysql-8-0

It's because MySQL8 specific syntax was used for the column renaming, so those who are running 5.7 will get this error.

Change the statements to this format:

ALTER TABLE table_name CHANGE old_column_name new_column_name <column definition>;

Zaloste commented 2 years ago

@MantisLord, Is it compatible with MySQL 8.0 now? Or is it still better to stick to 5.7 and make the changes? Because if that's the case I change the MySQL version without problems. Sorry for the silly questions.

adellaci commented 2 years ago

It is compatible with 8, you have to alter statement as he showed for 5.7

adellaci commented 2 years ago

my version i am running with out error mysql Ver 8.0.27

Zaloste commented 2 years ago

I prefer to change it to 8 then, for practical reasons, because then I don't have to keep changing these syntaxes. I'm running the server just for testing, so no problem. I'll do the tests with both version 5.7 and version 8, and as soon as I get it I'll close the topic. Thanks everyone for the replies.

Zaloste commented 2 years ago

It really went well, both with 5.7 doing what @MantisLord said, and with 8 too, but it's easier to install MySQL 8 right away. And for those who have the same problem as me, when changing MySQL if you choose to do so, don't forget to change the Environment Variable on Windows or you will get an error when executing ./InstallFullDB.sh

Solved! Thanks to all the team and people who helped me.

adellaci commented 2 years ago

@Zaloste Glad your problem is solved and you are back up