3

It happens on localhost for all my sites when I login I write the correct username and password but I get no error and the page just refreshes and won't let me into the WordPress dashboard.

For example I write:

http://localhost/business_theme/wp-admin

And I get:

http://localhost/business_theme/wp-login.php?redirect_to=http%3A%2F%2Flocalhost%2Fbusiness_theme%2Fwp-admin%2F&reauth=1

I also tried deleting the characters from ?redirect..., cleaning cookies but still it redirects.

Any ideas on how I can login to my WordPress sites again on localhost?

Dhruvin Moradiya
  • 546
  • 2
  • 10
  • 20
Light_Warrior
  • 183
  • 1
  • 4
  • 17
  • check the site name and url on the wp_options table also check the wp_config also checking the permissions on your user meta table – Masivuye Cokile Jan 31 '17 at 09:21
  • Take a backup of your current database and rename the plugin folder name. It will deactivate all plugins. – Dev Kiran Jan 31 '17 at 09:32
  • Does this answer your question? [Operation not allowed when innodb\_forced\_recovery > 0 \[SqlYog\]](https://stackoverflow.com/questions/25155777/operation-not-allowed-when-innodb-forced-recovery-0-sqlyog) – hongsy Jun 29 '21 at 06:38

2 Answers2

2

If your local site is the direct-copy of the site online, then this is just the case. WordPress redirects the page because it is trying to let you access the guessed-very-correct URL as the one you installed WordPress.

Open your database controller, find the table wp_options. Find the columns with option_name named site url and home, change the option_value to the corresponding URL in your local environment.

If not, there must be something wrong internal with your WordPress, turn on the debugging mode, and this will allow you more hint on this.

Haotian Liu
  • 886
  • 5
  • 19
  • The sites am I taking about are only localhost or were first installed on localhost with wordpress. I checked the urls and they both looks correct to me: http://localhost/business_theme (the urls are both the same) – Light_Warrior Jan 31 '17 at 09:26
  • @Light_Warrior right, this can be a case, see my update. – Haotian Liu Jan 31 '17 at 09:29
  • Thanks I found the issue: WordPress database error: [Operation not allowed when innodb_forced_recovery > 0.] INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('_transient_doing_cron', '1485855060.4561419486999511718750', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`) – Light_Warrior Jan 31 '17 at 09:31
0

I found the issue in debug mode:

WordPress database error: [Operation not allowed when innodb_forced_recovery > 0.]
INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('_transient_doing_cron', '1485855060.4561419486999511718750', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)

I just needed to set innodb_forced_recovery = 0; in "my.ini" file

Light_Warrior
  • 183
  • 1
  • 4
  • 17