Install WordPress Error: Connection to localhost failed

I cannot seem to get wordpress installed. I am able to login to the to MariaDB ‘localhost’. I have access to phpMyAdmin. Is there a solution?

The mariadb is running: root@server:~# sudo systemctl status mariadb
● mariadb.service - MariaDB 11.4.5 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf

Thank you.

root@server:~# mysql -u root -h localhost -p
mysql: Deprecated program name. It will be removed in a future release, use ‘/usr/bin/mariadb’ instead
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 149
Server version: 11.4.5-MariaDB-ubu2204 mariadb.org 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)]>