[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

systemctl status mariadb - Access denied for user root at localhost using password NO



-- System Information:
Debian GNU/Linux 12 (bookworm)
Linux server 6.1.0-12-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.52-1 (2023-09-07) x86_64 GNU/Linux
Version: systemd 252 (252.12-1~deb12u1) +PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified


-- Issue
I have installed Webmin, mariadb, and phpmyadmin

All the above is working
I can create databases from Webmin and create databases from phpmyadmin
and i can login to mysql

root@server:~# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
root@server:~# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 5958
Server version: 10.11.3-MariaDB-1 Debian 12

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)]>


But when i try


root@server:~# systemctl stop mariadb.service
root@server:~# systemctl restart mariadb.service
root@server:~# systemctl status mariadb.service
● mariadb.service - MariaDB 10.11.3 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; preset: enabled)
     Active: active (running) since Mon 2023-10-02 16:04:54 EEST; 17s ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 153057 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 153058 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 153060 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && s>
    Process: 153144 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 153146 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
   Main PID: 153131 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 14 (limit: 14299)
     Memory: 172.9M
        CPU: 744ms
     CGroup: /system.slice/mariadb.service
             └─153131 /usr/sbin/mariadbd

Oct 02 16:04:53 server systemd[1]: Starting mariadb.service - MariaDB 10.11.3 database server...
Oct 02 16:04:54 server systemd[1]: Started mariadb.service - MariaDB 10.11.3 database server.
Oct 02 16:04:54 server /etc/mysql/debian-start[153151]: Reading datadir from the MariaDB server failed. Got the following error when executing th>
Oct 02 16:04:54 server /etc/mysql/debian-start[153151]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Oct 02 16:04:54 server /etc/mysql/debian-start[153151]: FATAL ERROR: Upgrade failed
Oct 02 16:04:54 server debian-start[153160]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)


I don't know if the problem is from systemctl or from mariadb or from phpmyadmin,
I believe is systemctl because everything else seems is working

Can you please advise me what to do?

--
ppetros

Reply to: