Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.12.3 available

The official documentation can be found on https://wiki.ocsinventory-ng.org. Read it before asking your question.

Problem after changing mariadb root password... Help me plesase

Sorry for my bad English, as I did not remember the root password of my server mariadb, I did the process of recovering password, enter the following commands:

- systemctl stop mariadb
- mysqld_safe --skip-grant-tables --skip-networking &
- mysql -u root
- use mysql;
- UPDATE user SET password = PASSWORD ('password') WHERE user = 'root';
- flush privileges;

After restarting my server mariadb and my web server, entering my ocs shows me the following error

ERROR: MySql connection problem
Can not connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
ERROR: MySql connection problem
Can not connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)

Please help me......
in OCS Inventory NG server for Unix by (120 points)

1 Answer

0 votes
make sure you ocsweb database is still there and running
make sure you have user 'ocs'@'localhost' (or your ocs serveur hostname), and that he has all privileges on ocsweb, if necessary grant him all the privilieges again

in /usr/share/ocsinventory-reports/ocsreports/ edit dbconfig.inc.php
make sure the user/password is correct and the database host too :
define("DB_NAME", "ocsweb");
define("SERVER_READ","localhost");
define("SERVER_WRITE","localhost");
define("COMPTE_BASE","user");
define("PSWD_BASE","password");

in /etc/apache2/con.d edit z-ocsinventory-server.conf
again, make sure everything is in order :
# User allowed to connect to database
PerlSetEnv OCS_DB_USER user
# Password for user
PerlSetVar OCS_DB_PWD password

restart mysql service, apache, if its still not working, it should tho):
backup or drop ocsweb if you're okay with rebuilding it (google how to backup mysql db),
activate install.php on ocs server (you're supposed to have deleted it so just put it back there : /usr/share/ocsinventory-reports/ocreports/).
go to http://YourServerIpOrHostname/ocsreports/install.php and fill the forms with correct mysql informations, the server should find the existing db or rebuild it
by (640 points)
 
Powered by Question2Answer
...