0

So I am trying to run a django server but I keep getting this error.

my settings.py:

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'nlpwords',
    'USER': 'root',
    'PASSWORD': '',
    'HOST': 'localhost',
    'PORT': 3306,
  }
}

I have checked this question but the answer won't work for me: MySQL: django.db.utils.OperationalError: (1698, "Access denied for user 'root'@'localhost'") with correct username and pw

These are the lines that they give as an answer:

create user 'django'@'localhost' identified by 'django-user-password';
grant usage on *.* to 'django'@'localhost';
grant all privileges on django-database-1.* to 'django'@'localhost';

When I get to the last line I get this error:

MariaDB [mysql]> grant all privileges on django-database-1.* to 'django'@'localhost'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-database-1.* to 'django'@'localhost'' at line 1

eneko valero
  • 385
  • 1
  • 10

0 Answers0