$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>mysql - Where other than wp-config can database access details be defined?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin11PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far