Title: [Plugin: Wordfence Security] Null MySQL error
Last modified: August 20, 2016

---

# [Plugin: Wordfence Security] Null MySQL error

 *  Resolved [Ben Lobaugh (blobaugh)](https://wordpress.org/support/users/blobaugh/)
 * (@blobaugh)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordfence-security-null-mysql-error/)
 * On the scan page, before scanning
 * Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given
   in /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/plugins/wordfence/
   lib/wfLog.php on line 631
 * That was the only visible error I found on all the wf pages, however when I clicked
   scan an error popped up that the tables were missing. That is related to this
   issue:
    [http://wordpress.org/support/topic/wordfence-install-error](http://wordpress.org/support/topic/wordfence-install-error)
 * Perhaps in your registration hook you can check to ensure the tables have been
   created and if not display a message and disable the plugin?
 * [http://wordpress.org/extend/plugins/wordfence/](http://wordpress.org/extend/plugins/wordfence/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Mark Maunder](https://wordpress.org/support/users/mmaunder/)
 * (@mmaunder)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordfence-security-null-mysql-error/#post-2781157)
 * We do check that tables have been created in our activation hook and create the
   tables if they don’t exist. The check is also done every time you upgrade Wordfence
   through a mechanism outside the activation hook because it’s unreliable. Did 
   you manually delete the Wordfence tables? That’s the only way I can see that 
   you’d get this error.
 *  Thread Starter [Ben Lobaugh (blobaugh)](https://wordpress.org/support/users/blobaugh/)
 * (@blobaugh)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordfence-security-null-mysql-error/#post-2781159)
 * WF did NOT create the tables on install/activation. This is because your DB connector
   code has a bug in it that does not allow valid values for DB authentication. 
   See the following for the code fix [http://wordpress.org/support/topic/wordfence-install-error?replies=9](http://wordpress.org/support/topic/wordfence-install-error?replies=9).
   This is another reason to use the built in database object rather than creating
   your own 😉
 * Later on your code is not verifying that the tables have been successfully created.
   You should probably add a check to ensure the tables have been created/updated
   on activation/update and disable the plugin with a message to the user about 
   how to fix it if they are not available.
 *  Plugin Author [Mark Maunder](https://wordpress.org/support/users/mmaunder/)
 * (@mmaunder)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordfence-security-null-mysql-error/#post-2781160)
 * OK that makes sense. So the connection failed to get set up and the schema was
   never created. I’ve upped the priority on this fix.
 * Thanks very much for your detailed bug reports!
 * Mark.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: Wordfence Security] Null MySQL error’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Mark Maunder](https://wordpress.org/support/users/mmaunder/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/plugin-wordfence-security-null-mysql-error/#post-2781160)
 * Status: resolved