MariaDB Server: cannot connect as a root with "sudo mariadb" after deleted the 'test' database!


  • Hi Azure experts,

    I have been used MariaDB Server10.1.23 on Azure. But I had a mistake that I deleted the 'test' database! As a result, I cannot connect as a root user with "sudo mariadb" How can I be a root?

    Please help!

    miercuri, 16 mai 2018 13:13

Toate mesajele

  • Hi Ueda,

    Are you running an instance of CosmosDB or are you running an instance of MariaDB within a Virtual Machine? With Azure Linux VMs, there is no direct 'root' access. Root level access is provided via sudo. Perhaps you have a snapshot of the Azure VM? Please let me know how you have deployed MariaDB so I can investigate next steps.



    miercuri, 16 mai 2018 16:23
  • Hi Mike,

    * MariaDB within a  VM Linux
    * I have no snapshot

    Best regards,


    miercuri, 16 mai 2018 23:47
  • After editing /etc/mysql/conf.d/azure.conf, just comment out "test", It worked!

    It's OK?


    leo-admin@leo:~$ mysql --version
    mysql  Ver 15.1 Distrib 10.1.33-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
    leo-admin@leo:~$ cat  /etc/mysql/conf.d/azure.cnf
    #database = test

    bind-address =
    leo-admin@leo:~$ mysql -uroot
    ERROR 1698 (28000): Access denied for user 'root'@'localhost'
    leo-admin@leo:~$ sudo mariadb
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 5
    Server version: 10.1.33-MariaDB-1~xenial binary distribution

    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    MariaDB [(none)]> show databases;
    | Database               |
    | information_schema     |
    | mdl_20160301           |
    | mdl_20160301_analytics |
    | moodle_20170318        |
    | mysql                  |
    | performance_schema     |
    | phpmyadmin             |
    7 rows in set (0.01 sec)

    MariaDB [(none)]>

    joi, 17 mai 2018 05:40