Jump to content
  • 0

mangostwo DB setup - Possible Issue with code in InstallDatabases.sh - Access denied for user 'mangos'@'localhost' (using password: YES)


Go to solution Solved by Elmsroth,

Question

I have successfully cloned, built, installed the mangostwo project and extracted all of the map data (I think). However, I am hitting a snag on the DB setup. 

I am using this guide: 


I've installed mysql-server with 

sudo apt install mysql-server

Then I switched to root and loaded up mysql to do this command (which, BTW, "privileges" is misspelled in the guide:

CREATE USER 'mangos'@'localhost' IDENTIFIED BY 'mangos';
GRANT ALL PRIVILEGES ON *.* TO 'mangos'@'localhost' WITH GRANT OPTION;

I exited, and did 

cd /home/mangos/db/
git clone https://github.com/mangoszero/database.git . --recursive --depth=1
./InstallDatabases.sh

(in the guide, the pictures are dead links, so I can't see what Database options to use, but I did mysql host name = localhost, mysql user name = mangos, mysql port = 3306, then I typed in my mangos linux user's password (which I also manually set the mangos mysql user's password to).  Then I did all of the default database names.

Then, I get a big string of these errors:

Importing file World/Setup/FullDB/spell_learn_spell.sql
ERROR 1045 (28000): Access denied for user 'mangos'@'localhost' (using password: YES)
File World/Setup/FullDB/spell_learn_spell.sql imported
Importing file World/Setup/FullDB/spell_loot_template.sql
ERROR 1045 (28000): Access denied for user 'mangos'@'localhost' (using password: YES)
File World/Setup/FullDB/spell_loot_template.sql imported

I looked at the InstallDatabases.sh script, and I feel like there is an issue.

printBanner
printf "What is your MySQL host name ?\t[${svr_def}]: "
read svr
svr=${svr:-${svr_def}}
printf "What is your MySQL user name ?\t[${user_def}]: "
read user
user=${user:-${user_def}}
printf "What is your MySQL port ?\t[${port_def}]: "
read port
port=${port:-${port_def}}
printf "What is your MySQL password ?\t [], "
mysql_config_editor set --login-path=local --host=${svr} --port=${port} --user=${user} --password --skip-warn
if [ "${DUMP}" = "YES" ]; then
        printf "Enter it again \t[]: "
        read pass
fi

Here is the prompt for password. 1) It looks like the script doesn't even store the password in a variable. And 2) mysql_config_editor DEFINITELY prompts the user for a password if you use the --password flag like that. So... I feel like I'm totally missing something.  Thoughts?
 

Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

The error is normally caused by one of 3 things:

1) The username/password is incorrect for the database
2) The username doesn't have permission to write to the database
3) The database server cannot be accessed correctly

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use