Can't Connect to DB

Discussion in 'ISPConfig 3 Priority Support' started by yupthatguy, Oct 5, 2021.

  1. yupthatguy

    yupthatguy Member

    Same instructions are on page 400 of the ISPConfig manual
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    According to the output you posted, you did not enable debug log level on the master for the slave system that you want to debug. Go to System > Server config again and enable the debug log level. Then create a new database user and new database and then run
    /usr/local/ispconfig/server/server.sh and post the result.
     
  3. yupthatguy

    yupthatguy Member

    I did this action before... for whatever reason it didn't save the changes.. so now I will screenshot everything and set-up for a screencast if I need to.

    [​IMG]
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no screencast needed, just do the steps that I described and post the result.
     
  5. yupthatguy

    yupthatguy Member

    So I changed it to debug... went through deleted and re-created everything, then ran server.sh
    Again no feedback...

    So I checl the Log level again and it has "revereted" back to error level
    [​IMG]
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig does not contain any code which may revert such a change, so either it was not changed/saved or the underlying database is broken in a way that it is not able to save changes anymore. You are logged in as user 'admin' when you do that and not with another user that you may have created in ISPConfig (only the user admin has superuser privileges to alter the system config, no other user which you may have created can do that)? If user 'admin' can't save changed in system config and you are sue (in case of a multiserver system) that you edited the right server, then maybe the dbispconfig MySQL database is broken on database level so that no changes can get saved anymore by MySQL.
     
  7. yupthatguy

    yupthatguy Member

    :(

    Ok... I changed to debug level again for the log AND the email warning... and this time I ran server.sh after I clicked "save" on the server config page... I finally got output:
    Code:
    # /usr/local/ispconfig/server/server.sh
    07.10.2021-09:51 - DEBUG - Calling function 'check_phpini_changes' from plugin 'webserver_plugin' raised by action 'server_plugins_loaded'.
    07.10.2021-09:51 - DEBUG - safe_exec cmd: grep ^opcache.validate_root '/etc/php/7.3/apache2/php.ini' - return code: 0
    07.10.2021-09:51 - DEBUG - safe_exec cmd: grep ^opcache.validate_root '/etc/php/7.3/fpm/php.ini' - return code: 0
    07.10.2021-09:51 - DEBUG - safe_exec cmd: grep ^opcache.validate_root '/etc/php/7.3/cgi/php.ini' - return code: 0
    07.10.2021-09:51 - DEBUG - Found 2 changes, starting update process.
    07.10.2021-09:51 - DEBUG - Calling function 'server_ip' from plugin 'apache2_plugin' raised by event 'server_update'.
    07.10.2021-09:51 - DEBUG - safe_exec cmd: which 'apache2ctl' 2> /dev/null - return code: 0
    07.10.2021-09:51 - DEBUG - Writing the conf file: /etc/apache2/sites-available/ispconfig.conf
    07.10.2021-09:51 - DEBUG - Calling function 'update' from plugin 'apps_vhost_plugin' raised by event 'server_update'.
    07.10.2021-09:51 - DEBUG - safe_exec cmd: which 'apache2ctl' 2> /dev/null - return code: 0
    07.10.2021-09:51 - DEBUG - Calling function 'update' from plugin 'network_settings_plugin' raised by event 'server_update'.
    07.10.2021-09:51 - DEBUG - Calling function 'update' from plugin 'postfix_server_plugin' raised by event 'server_update'.
    07.10.2021-09:51 - DEBUG - safe_exec cmd: postconf -e 'smtpd_client_restrictions = check_client_access proxy:mysql:/etc/postfix/mysql-virtual_client.cf, permit_inet_interfaces, permit_mynetworks, permit_sasl_authenticated, reject_rbl_client zen.spamhaus.org, reject_unauth_pipelining, permit' - return code: 0
    07.10.2021-09:51 - DEBUG - safe_exec cmd: postconf -e 'smtpd_helo_restrictions = permit_mynetworks, check_helo_access regexp:/etc/postfix/helo_access, permit_sasl_authenticated, reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, check_helo_access regexp:/etc/postfix/blacklist_helo, reject_unknown_helo_hostname, permit' - return code: 0
    07.10.2021-09:51 - DEBUG - safe_exec cmd: which 'dovecot' 2> /dev/null - return code: 0
    07.10.2021-09:51 - DEBUG - Calling function 'server_update' from plugin 'rspamd_plugin' raised by event 'server_update'.
    07.10.2021-09:51 - DEBUG - Calling function 'update' from plugin 'server_services_plugin' raised by event 'server_update'.
    07.10.2021-09:51 - DEBUG - Calling function 'server_update' from plugin 'webserver_plugin' raised by event 'server_update'.
    07.10.2021-09:51 - DEBUG - Processed datalog_id 1379
    07.10.2021-09:51 - DEBUG - Calling function 'server_ip' from plugin 'apache2_plugin' raised by event 'server_update'.
    07.10.2021-09:51 - DEBUG - safe_exec cmd: which 'apache2ctl' 2> /dev/null - return code: 0
    07.10.2021-09:51 - DEBUG - Writing the conf file: /etc/apache2/sites-available/ispconfig.conf
    07.10.2021-09:51 - DEBUG - Calling function 'update' from plugin 'apps_vhost_plugin' raised by event 'server_update'.
    07.10.2021-09:51 - DEBUG - safe_exec cmd: which 'apache2ctl' 2> /dev/null - return code: 0
    07.10.2021-09:51 - DEBUG - Calling function 'update' from plugin 'network_settings_plugin' raised by event 'server_update'.
    07.10.2021-09:51 - DEBUG - Calling function 'update' from plugin 'postfix_server_plugin' raised by event 'server_update'.
    07.10.2021-09:51 - DEBUG - safe_exec cmd: postconf -e 'smtpd_client_restrictions = check_client_access proxy:mysql:/etc/postfix/mysql-virtual_client.cf, permit_inet_interfaces, permit_mynetworks, permit_sasl_authenticated, reject_rbl_client zen.spamhaus.org, reject_unauth_pipelining, permit' - return code: 0
    07.10.2021-09:51 - DEBUG - safe_exec cmd: postconf -e 'smtpd_helo_restrictions = permit_mynetworks, check_helo_access regexp:/etc/postfix/helo_access, permit_sasl_authenticated, reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, check_helo_access regexp:/etc/postfix/blacklist_helo, reject_unknown_helo_hostname, permit' - return code: 0
    07.10.2021-09:51 - DEBUG - safe_exec cmd: which 'dovecot' 2> /dev/null - return code: 0
    07.10.2021-09:51 - DEBUG - Calling function 'server_update' from plugin 'rspamd_plugin' raised by event 'server_update'.
    07.10.2021-09:51 - DEBUG - Calling function 'update' from plugin 'server_services_plugin' raised by event 'server_update'.
    07.10.2021-09:51 - DEBUG - Calling function 'server_update' from plugin 'webserver_plugin' raised by event 'server_update'.
    07.10.2021-09:51 - DEBUG - Processed datalog_id 1380
    07.10.2021-09:51 - DEBUG - Calling function 'restartHttpd' from module 'web_module'.
    So I kept going. This the deletion of the user & db:
    Code:
    # /usr/local/ispconfig/server/server.sh
    07.10.2021-09:55 - DEBUG - Calling function 'check_phpini_changes' from plugin 'webserver_plugin' raised by action 'server_plugins_loaded'.
    07.10.2021-09:55 - DEBUG - Found 3 changes, starting update process.
    07.10.2021-09:55 - DEBUG - Calling function 'db_delete' from plugin 'mysql_clientdb_plugin' raised by event 'database_delete'.
    07.10.2021-09:55 - DEBUG - Calling DROP for c1_wpdb with access rw and hosts localhost
    07.10.2021-09:55 - DEBUG - DROP for user  at host localhost
    07.10.2021-09:55 - DEBUG - Dropping MySQL database: c1_wpdb
    07.10.2021-09:55 - DEBUG - Processed datalog_id 1381
    07.10.2021-09:55 - DEBUG - Calling function 'db_user_delete' from plugin 'mysql_clientdb_plugin' raised by event 'database_user_delete'.
    07.10.2021-09:55 - DEBUG - Dropping MySQL user: c1_wpdb
    07.10.2021-09:55 - DEBUG - Processed datalog_id 1382
    07.10.2021-09:55 - DEBUG - Calling function 'db_user_delete' from plugin 'mysql_clientdb_plugin' raised by event 'database_user_delete'.
    07.10.2021-09:55 - DEBUG - Processed datalog_id 1383
    07.10.2021-09:55 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    
    This is the creation of the new user and db:
    Code:
    # /usr/local/ispconfig/server/server.sh
    07.10.2021-10:01 - DEBUG - Calling function 'check_phpini_changes' from plugin 'webserver_plugin' raised by action 'server_plugins_loaded'.
    07.10.2021-10:01 - DEBUG - Found 3 changes, starting update process.
    07.10.2021-10:01 - DEBUG - Calling function 'db_user_insert' from plugin 'mysql_clientdb_plugin' raised by event 'database_user_insert'.
    07.10.2021-10:01 - DEBUG - Processed datalog_id 1384
    07.10.2021-10:01 - DEBUG - Calling function 'db_user_update' from plugin 'mysql_clientdb_plugin' raised by event 'database_user_update'.
    07.10.2021-10:01 - DEBUG - Processed datalog_id 1385
    07.10.2021-10:01 - DEBUG - Calling function 'db_insert' from plugin 'mysql_clientdb_plugin' raised by event 'database_insert'.
    07.10.2021-10:01 - DEBUG - Created MySQL database: c1_wpdb
    07.10.2021-10:01 - DEBUG - Calling GRANT for c1_wpdb with access rw and hosts localhost
    07.10.2021-10:01 - DEBUG - GRANT for user c1_wpdb at host localhost
    07.10.2021-10:01 - DEBUG - CREATE USER 'c1_wpdb'@'localhost'
    07.10.2021-10:01 - DEBUG - PASSWORD SET FOR 'c1_wpdb'@'localhost' success? yes
    07.10.2021-10:01 - DEBUG - GRANT ALL PRIVILEGES ON `c1_wpdb`.* TO 'c1_wpdb'@'localhost' success? yes
    07.10.2021-10:01 - DEBUG - Processed datalog_id 1386
    07.10.2021-10:01 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    finished server.php.
    
     
  8. yupthatguy

    yupthatguy Member

    apparently, clicking "save" is beyond my skill set... :mad:
    Same problem
    [​IMG]
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so the user and database get created successfully. You must be able to login now to this database, test it on the shell of the server:

    mysql -h localhost -u c1_wpdb -p c1_wpdb

    and then enter the password when the commands requests it.

    Btw. Is this a single or multiserver setup? If multiserver, are you creating the database and the website on the same server?
     
  10. yupthatguy

    yupthatguy Member

    Single server... vbox test server for prod... near identical
    Code:
    root@tester1:~# mysql -h localhost -u c1_wpdb -p
    Enter password:
    ERROR 1045 (28000): Access denied for user 'c1_wpdb'@'localhost' (using password: YES)
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    First, the command you use is not the one I posted, you missed the db name at the end of the command, test again by using the right command:

    mysql -h localhost -u c1_wpdb -p c1_wpdb

    If it does not work, test again by using:

    mysql -h 127.0.0.1 -u c1_wpdb -p c1_wpdb
     
  12. yupthatguy

    yupthatguy Member

    Code:
    root@tester1:~# mysql -h localhost -u c1_wpdb  -p c1_wpdb
    Enter password:
    ERROR 1045 (28000): Access denied for user 'c1_wpdb'@'localhost' (using password: YES)
    Code:
    # mysql -h 127.0.0.1 -u c1_wpdb -p c1_wpdb
    Enter password:
    ERROR 1045 (28000): Access denied for user 'c1_wpdb'@'localhost' (using password: YES)
    
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    Does the password maybe contain umlauts, which might cause issues? Did you try to set a simple password for a test that just contains characters a-z (upper and lower case) and 0-9? And are you able to log in as root user to MySQL on the shell or via phpmyadmin?

    mysql -h localhost -u root -p
     
  14. yupthatguy

    yupthatguy Member

    Mu$^Ua F$*Ker!

    that did it... I use a password app that manages and creates strong pwds for me...

    this was the previous passwor: +'ZmTDnbp8$5g;`zoR:x

    I made new passwrd without "special characters"...

    now IT WORKS!

    Thanks!
     

Share This Page