最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Connect to MySQL using Windows Authentication

programmeradmin1浏览0评论

Is it possible to have Wordpress/PHP connect to my MySQL database using Windows Authentication on IIS? I can connect just fine using the normal MySQL command line utilities. I get the following error instead:

Warning: mysqli_real_connect(): The server requested authentication method unknown to the client [authentication_windows_client] in c:\wordpress\wp-includes\wp-db.php on line 1386

Warning: mysqli_real_connect(): (HY000/2054): The server requested authentication method unknown to the client in c:\wordpress\wp-includes\wp-db.php on line 1386

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in c:\wordpress\wp-includes\wp-db.php on line 1416

Warning: mysql_connect(): The server requested authentication method unknown to the client [authentication_windows_client] in c:\wordpress\wp-includes\wp-db.php on line 1416

Warning: mysql_connect(): The server requested authentication method unknown to the client in c:\wordpress\wp-includes\wp-db.php on line 1416

Is it possible to have Wordpress/PHP connect to my MySQL database using Windows Authentication on IIS? I can connect just fine using the normal MySQL command line utilities. I get the following error instead:

Warning: mysqli_real_connect(): The server requested authentication method unknown to the client [authentication_windows_client] in c:\wordpress\wp-includes\wp-db.php on line 1386

Warning: mysqli_real_connect(): (HY000/2054): The server requested authentication method unknown to the client in c:\wordpress\wp-includes\wp-db.php on line 1386

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in c:\wordpress\wp-includes\wp-db.php on line 1416

Warning: mysql_connect(): The server requested authentication method unknown to the client [authentication_windows_client] in c:\wordpress\wp-includes\wp-db.php on line 1416

Warning: mysql_connect(): The server requested authentication method unknown to the client in c:\wordpress\wp-includes\wp-db.php on line 1416
Share Improve this question asked Apr 8, 2015 at 23:44 DigitalDDigitalD 1113 bronze badges 3
  • Are you modifying WordPress Core? If so this is extremely bad. There are far better ways to change the behavior of WPDB than editing the core files directly – Tom J Nowell Commented Apr 9, 2015 at 0:34
  • @TomJNowell I haven't done that at all. I'm using an official auth plugin for MySQL as I linked above. – DigitalD Commented Apr 9, 2015 at 4:16
  • Very late I know, but I'd guess you just have to make sure that your PHP is using the enterprise version of the mysql client libraries rather than the one it was supplied with. This may mean rebuilding the php_mysqli extension. You might also need to prevent WordPress trying to supply a password, albeit an empty one, which you can probably do by a drop-in db.php to modify the wpdb class. – Rup Commented Sep 23, 2019 at 12:31
Add a comment  | 

1 Answer 1

Reset to default -1

This is just bad security method.

Because the only way you can connect to the mysql database is via that pc you use.

Where is if you username/pwd, you can move the site to another server, etc.

So Windows Authentication is a bad idea, too easy to overcome, and honestly just not that secure.

Where as a username and strong password, that changes every so often, that's much better security.

But it's like this, if your insistent on driving your car over a cliff, we won't get in your way, but you won't like the results of your choices.

发布评论

评论列表(0)

  1. 暂无评论