you need to check and correct the credentials for the database. If you do not have the credentials for a superuser who is allowed to crate a new database and users (depends on the hosting), you probably need to create a database and a database user via the UI of the hosting provider and then enter the respective data in the config screen.
I used the instructions given at Dolibarr for Ubuntu or Debian - Dolibarr ERP CRM Wiki, which says, “In a few seconds, after installing this package, you are able to work on Dolibarr, even if you don’t have already a web server or if you don’t know what is Apache/Lighttpd, Mysql or PHP. Everything is installed for you.” So, I assume the database and all are already installed.
As instructed during the “Dolibarr install or upgrade - Configuration file” install step, I enter only a password for the “User account for the Dolibarr database owner”. Then, I get this same database connection failure:
I try the suggestion given, which is “sudo service mysql start”. That’s when I find out there is no MySQL database daemon running. I am a sysadmin, so I also try to connect to the MySQL server with the MySQL client and there is no server socket available:
sudo service mysql start
Failed to start mysql.service: Unit mysql.service not found.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Looking at the installation log I don’t see any database packages installed. I see that the mysql-common, libmysqlclient21, mariadb-client, mariadb-client-10.3, mariadb-client-core-10.3, mariadb-common packages are all installed, but no mysql-server nor mariadb-server. Why wouldn’t the database packages be a dependency for Dollibarr? Can someone help? Do I just need to install MySQL before Dollibarr? I’m a new user to the forum, so I can’t post or upload the installation log. Sorry.
Yes, that helped. I also had some problems getting the installation script to work. I had to create the Dolibarr user and grant it full permissions to the Dolibarr database manually. The install script was having trouble using my root mysql user to do that. Now, I am finally up and running. Thank you.