mysql - Where other than wp-config can database access details be defined?

admin2025-05-31  5

I'm trying to sort out some problems on a WordPress installation. I created it, and I am the only person with access to the server (at least, I should be), but someone else administers it and can install plugins through the web interface. It's breaking with fatal errors, so my first thought was to disable all plugins, which can be done by editing the database directly.

Step one: access the database:

$ cat wp-config.php | grep DB

and ... nothing.

In fact, here's wp-config.php in its entirety:

<?php
define('WP_CACHE', true); // Added by Cache Enabler

How can this happen? And where else are the database access details stored?

I can't see them anywhere else, either:

# grep -nri db_name
wp-admin/setup-config.php:260:  define('DB_NAME', $dbname);
wp-admin/setup-config.php:330:          case 'DB_NAME'     :
wp-includes/load.php:404:   $wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );
wp-includes/ms-load.php:480:            '<code>' . DB_NAME . '</code>'
wp-config-sample.php:23:define('DB_NAME', 'database_name_here');

Where else should I look for database access details? Or should I assume that something has gone horribly wrong?

I'm trying to sort out some problems on a WordPress installation. I created it, and I am the only person with access to the server (at least, I should be), but someone else administers it and can install plugins through the web interface. It's breaking with fatal errors, so my first thought was to disable all plugins, which can be done by editing the database directly.

Step one: access the database:

$ cat wp-config.php | grep DB

and ... nothing.

In fact, here's wp-config.php in its entirety:

<?php
define('WP_CACHE', true); // Added by Cache Enabler

How can this happen? And where else are the database access details stored?

I can't see them anywhere else, either:

# grep -nri db_name
wp-admin/setup-config.php:260:  define('DB_NAME', $dbname);
wp-admin/setup-config.php:330:          case 'DB_NAME'     :
wp-includes/load.php:404:   $wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );
wp-includes/ms-load.php:480:            '<code>' . DB_NAME . '</code>'
wp-config-sample.php:23:define('DB_NAME', 'database_name_here');

Where else should I look for database access details? Or should I assume that something has gone horribly wrong?

Share Improve this question asked Jul 6, 2017 at 21:42 TRiGTRiG 1658 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

A quick way to disable all plugins is to rename the wp-content\plugins folder. You'll get some complaints on the wp-admin pages about missing plugins getting disabled, but you knew that.

Database access details are in the wp-config.php file in the root of your WP installation.

Usually plugins are the main cause of weirdness. Error logs will tell you many things. If you think you need to, reinstall the WP core files (on the admin/update page). Then ensure that all themes and updates are updated. Then, if still weirdness, look at the error logs for help.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748640719a313715.html

最新回复(0)