skip to Main Content

I’ve got a little problem with my database permissions. I created a user with literally no rights to test a database class I’m writing on my local machine. So now if I try to change the charset on an existing database via ‘ALTER DATABASE’ I just get an empty result and the character set is changed. No error for missing permissions. However, if I try the same thing on a not existing database I get as expected the missing permission error. I also tried the same thing for the ‘CREATE DATABASE’ statement and for this, it gives me an error for my user. So what I’m doing wrong? Did anyone get a solution for this?

Database system:

  • Server: 127.0.0.1 via TCP/IP
  • Server-Typ: MariaDB
  • Server-Verbindung: SSL wird nicht verwendet
  • Dokumentation Server-Version: 10.4.17-MariaDB – mariadb.org binary distribution
  • Protokoll-Version: 10

Connection via PHP file with mysqli.

2

Answers


  1. If you create a user with no permissions and you still get access then
    IT IS the database which allows ALL users to apply changes.
    Check your database configuratio.
    You can also give us further data to help you configure it.

    Login or Signup to reply.
  2. The problem is not reproducable:

    MariaDB [(none)]> select @@version;
    +--------------------+
    | @@version          |
    +--------------------+
    | 10.5.8-MariaDB-log |
    +--------------------+
    1 row in set (0.000 sec)
    
    MariaDB [(none)]> show grants;
    +--------------------------------------+
    | Grants for @localhost                |
    +--------------------------------------+
    | GRANT USAGE ON *.* TO ``@`localhost` |
    +--------------------------------------+
    1 row in set (0.000 sec)
    
    MariaDB [(none)]> create database ThisOneDoesNotExistYet;
    ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'ThisOneDoesNotExistYet'
    MariaDB [(none)]>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search