Could not connect to MySQL database

I am trying to intall Trinity core for the first time, It was going well untill i reached the part where i had to run authserver.exe and worldserver.exe. When i open any of those two, it instantly crashes and in the DBErrors.txt, this was the only line written in it - Could not connect to MySQL database at 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (10061). I have tried to update the databases using sqlog and running the scripts from \TrinityCore\sql\updates folder for auth, world and characters(not sure if this is the correct way to update, if it is not please point out he correct way to update databases :slight_smile: ). Could I get some suggestions on how to fix this? I have already tried to go through

but I could not find any issues related to this one. I only want to play offline without any players joining in.

If I’m not mistaken, then you need to change 127.0.0.1 to your IP to which you are connecting (unless of course it is localhost)

Thanks for the reply jojo, can you specify for which file should i change the address?

for files authserver.conf, worldserver.conf and also you need to add your ip to the list of allowed in MySQL (this is done in the configuration file MySql)

Did you change the worldserver.conf and authserver.conf files to point to your DB (username password and correct path)

Yes, I changed it. It is also necessary to modify the realmlist file in the database (auth)

Good evening, I have added the following lines to worldserver.conf -

	WorldDatabaseInfo     = "127.0.0.1;3307;trinity;trinity;world"
	CharacterDatabaseInfo = "127.0.0.1;3307;trinity;trinity;characters"

and LoginDatabaseInfo = "127.0.0.1;3307;trinity;trinity;auth" for auth.conf. I had to choose port 3307 while installing sql since 3306 was already in use, could this cause any issues? and also I am not sure how to add this part.

Are you able to connect to your database using something like SQLyog or HeidiSQL using port 3307 and the username trinity, password trinity. If you can you should be good. Personally, i would uninstall MYSQL and re-install it to use the correct port.

As for installing the database, you shouldn’t be doing it manually. Just put it in the BIN folder and let it do it by itself.

You need to read over the WIKI again and follow the steps exactly.

remove or comment off directive bind_address in /etc/my.cnf file & restart mysql service (status “running” in win services)

Or change it to external white IP if you maintain lan srv

or try

bind-address = 0.0.0.0 (if MariaDB)

updates are applied by worldserver.

Thank you for the suggestions Skipper and lucian, i will try these methods today and will let you know if it works, also if my ports are blocked, will that prevent my sql server from running?

Ok, i have basically reinstalled Mysql again since there were some other instances of mysql server running in my windows services using the default 3306 port. Now i just tried to run authserver and it gives me this error - “Could not connect to MySQL database at 127.0.0.1: Access denied for user ‘trinity’@‘localhost’ (using password: YES)”. I guess i will try to resolve this tomorrow since this is a different error. If you guys know how to resolve this feel free to comment or close this thread since this is now a different error. Thanks for helping out! :slight_smile:

Have you created the user trinity in MySQL and given it elevated privileges and verified you can log in using the set username and password?

Google is your friend.

hmm… I made a post