[SOLVED][PyPlanet] Database access error

Python 3 Server Controller for Trackmania and Shootmania for script-only modes.

Moderators: TheM, toffe, NADEO

Locked
elie520
Posts: 92
Joined: 17 Feb 2017, 13:16

[SOLVED][PyPlanet] Database access error

Post by elie520 » 30 Jun 2018, 10:49

Hi,

I'm trying to configure PyPlanet on one of my serverss. I followed the PyPlanet documentation (see http://pyplanet.readthedocs.io/en/lates ... ation.html). When I try to start the controller with

Code: Select all

./manage.py start
j'ai l'erreur suivante :

Code: Select all

peewee.InternalError: (1698, "Access denied for user 'me'@'localhost'")
What surprises me, is that I don't need a pw to access my mysql, so I don't understand. Here is my basy.py DATABASES part:

Code: Select all

DATABASES = {
        'default': {
                'ENGINE': 'peewee_async.MySQLDatabase',
                'NAME': 'ma_db',
                'OPTIONS': {
                        'host': 'localhost',
                        'user': 'me',
                        'password': ' ',
                        'charset': 'utf8mb4',
                }
        }
}
If you have any idea, i'd be glad :)

Thanks!
Last edited by elie520 on 30 Jun 2018, 18:56, edited 1 time in total.

User avatar
toffe
Posts: 690
Joined: 15 Jun 2013, 10:57
Location: The Netherlands
Contact:

Re: [PyPlanet] Database access error

Post by toffe » 30 Jun 2018, 16:30

Hello elie520,

First of all, thanks trying out PyPlanet. I think you made a small mistake in your password configuration. When you have a MySQL user without a password, just enter an empty string (so not with the space, you currently have).

Adjusted version of your provided configuration file with the space replaced by just an empty string:

Code: Select all

DATABASES = {
        'default': {
                'ENGINE': 'peewee_async.MySQLDatabase',
                'NAME': 'ma_db',
                'OPTIONS': {
                        'host': 'localhost',
                        'user': 'me',
                        'password': '',
                        'charset': 'utf8mb4',
                }
        }
}
Please let me know if this worked out for you, and if you need any further asssitance,

Thank you,
Toffe

elie520
Posts: 92
Joined: 17 Feb 2017, 13:16

Re: [PyPlanet] Database access error

Post by elie520 » 30 Jun 2018, 17:02

Hi, thanks for your answer.
Sorry for this, I actually tried it first with the empty string. I just tried several things to make it work before posting here, including entering a random password, or a ' ' password. In either cases, I get the same problem. Actually, I do everything under root privilege, and root session, is that a problem? For this post I wrote 'me' but it's actually root all along.

Thanks for your help!!

User avatar
toffe
Posts: 690
Joined: 15 Jun 2013, 10:57
Location: The Netherlands
Contact:

Re: [PyPlanet] Database access error

Post by toffe » 30 Jun 2018, 18:19

Hi,

It might be that the user root doesn't have the right privileges from the pyplanet instance. A better solution would be to create a separate account and grant the database rights to that specific account.

Hit me up on discord and I'll help you complete your installation :-) : Toffe#8999

Toffe

elie520
Posts: 92
Joined: 17 Feb 2017, 13:16

Re: [PyPlanet] Database access error

Post by elie520 » 30 Jun 2018, 18:55

Many many many many thanks to toffe <3

It indeed worked with a new account with all the permissions to the database. In MySQL:

Code: Select all

CREATE USER 'new_user'@'localhost' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON the_server_db.* TO 'new_user'@'localhost';
and in basy.py:

Code: Select all

DATABASES = {
        'default': {
                'ENGINE': 'peewee_async.MySQLDatabase',
                'NAME': 'the_server_db',
                'OPTIONS': {
                        'host': 'localhost',
                        'user': 'new_user',
                        'password': '',
                        'charset': 'utf8mb4',
                }
        }
}
Once more, thank you very much <3

User avatar
toffe
Posts: 690
Joined: 15 Jun 2013, 10:57
Location: The Netherlands
Contact:

Re: [SOLVED][PyPlanet] Database access error

Post by toffe » 30 Jun 2018, 18:59

No problem. I'm happy that it's solved. Enjoy using PyPlanet :-)

Locked

Return to “PyPlanet”

Who is online

Users browsing this forum: No registered users and 2 guests