php - Database Connection error using sql server and codeigniter in IIS
问题描述
Error to connect MSSQL database through PHP I can't able to connect to sql server database in remote system. It is showing Unable to connect to your database server using the provided settings. Filename:
returns the bellow error..
Array ( [0] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user 'NT AUTHORITY\IUSR'. [message] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user 'NT AUTHORITY\IUSR'. ) [1] => Array ( [0] => 42000 [SQLSTATE] => 42000 [1] => 4060 [code] => 4060 [2] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Cannot open database "pestcontrol" requested by the login. The login failed. [message] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Cannot open database "pestcontrol" requested by the login. The login failed. ) )
解决方案
这可以解决你的问题
$db['default']['username'] = 'root';
$db['default']['password'] = '';
它是 xampp、lampp 和 wampp 中的默认设置。如果您想创建自己的凭证,您可以在给定的代码中编写它。
或试试这个链接:
推荐阅读
- django - Axios put 请求无法与 Django Rest Framework 一起正常工作
- c++ - C++ 中的 CreateDirectory windows API 使用在 C:/users 下创建目录而不以管理员身份运行应用程序
- python - 我的 Python 代码出现数学域错误,不知道该怎么做
- python - 使用正则表达式检测具有 if 语句的 jinja2 变量 - python
- django - 如何用 django 存储数学公式
- sql - Oracle - PLSQL 在截断/加载过程后检查记录数的差异
- jquery - 基于jQuery中动态添加的类更改点击事件延迟
- html - 如何增加一颗行星?html5 css3 动画
- python - Python:冒泡排序的列表索引超出范围
- eclipse-plugin - 以编程方式从打开的 xtext 编辑器访问完成建议