sakila ERROR 1044 (42000) at line 46412: Access denied for user 'ted'@'localhost' to database 'sakila'

753 Views Asked by At

My OS is Ubuntu 16.04 LTS and I am deploying the sakila database for learning mysql and have done the following:

  1. Downloaded the file "sakila-db.tar.gz from https://downloads.mysql.com/docs/ to the directory "/tmp" with no problem
  2. $ cd /tmp
  3. $ gzip -cd sakila-db.tar.gz | tar xvf - Files sakila-data.sql, sakila-schema.sql and sakila.mwb were extracted to diredctory "sakila-db"
  4. $ cd sakila-db
  5. $ mysql -u root -p < sakila-schema.sql (command executed successfully)
  6. $ mysql -u root -p
    (to grant privileges to user for the sakila database)
  7. mysql> GRANT CREATE, DROP, ALTER, INSERT, UPDATE, SELECT, DELETE, INDEX, CREATE VIEW, CREATE ROUTINE, ALTER ROUTINE, EXECUTE, TRIGGER, INDEX ON sakila.* TO 'jump'@'localhost';

    (command executed successfully)

  8. mysql> GRANT SUPER, RELOAD, FILE ON *.* TO 'ted'@'localhost'; (granting these global commands to user ted - command executed OK)
  9. mysql> exit
  10. Trying to populate the sakila tables with data from sakila-data.sql

    $ mysql -u ted -p < sakila-data.sql

Enter password:

ERROR 1044 (42000) at line 46412: Access denied for user 'ted'@'localhost' to database 'sakila'

This is my problem, can anyone help me solve this?

1

There are 1 best solutions below

0
On

I found a solution to my problem by issuing the following commands: Connecting to mysql: $ mysql -u root -p; Issuing a global grant on the database: GRANT ALL PRIVILEGES ON . TO 'ted'@'localhost' WITH GRANT OPTION; Then exiting mysql; Issuing the command: $ mysql -u ted -p mysql> use mysql; but ... ERROR 1044 (42000): Access denied for user '' @ 'localhost' to database 'mysql'.