0

I am trying to make a read only and a full privledge admin user to my database with the following code:

DROP USER IF EXISTS 'readonly'@'localhost';
CREATE USER 'readonly'@'localhost' IDENTIFIED BY 'Readonly1934@';
GRANT SELECT ON bank_assignment.* TO 'readonly'@'localhost';

DROP USER IF EXISTS 'admin'@'localhost';
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin2131@';
GRANT SELECT, INSERT, DROP, ALTER ON bank_assignment.* TO 'admin'@'localhost';

The first user made on its own works fine, but when I add another user it gives me a command out of sync error. I've tried also flushing privileges before and after. Same eror. Does anybody know why?

3
  • I don't think there is anything wrong with your SQL - tested and works for me. It might be your database tool (phpmyadmin?) getting in the way. Try running the same code from the mariadb command-line tool instead and see if that works for you.
    – dbdemon
    Commented Dec 16, 2021 at 17:53
  • yeah seems it could be xampp and phpmyadmin, however for my task i need to use these tools only, slightly annoying ah well. Commented Dec 16, 2021 at 19:33
  • It seems to be xampp, I basically can have 1 stored procedure but not 2? its so weird Commented Dec 16, 2021 at 20:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.