Open dariaman opened 8 years ago
in terminal, not problem
I'm sorry , I edited db.php 'dsn' => 'dblib:host=192.168.200.200;database=MGM;MultipleActiveResultSets=false',
but another error
SQLSTATE[HY000]: General error: 20018 Invalid object name 'auth_item_child'. [20018] (severity 16) [(null)]
The SQL being executed was: SELECT [child] FROM [auth_item_child] WHERE [parent]='commonPermission'
do you have auth_item_child
table in your db?
yes, i used extension yii2 user-management with default configuration, any one can try this module and i try in windows well without problem, and then i upload to server linux
i know the problem, my config
'dsn' => 'dblib:host=192.168.200.200,1433;database=mydb;MultipleActiveResultSets=false',
but the default database is master so the table user is unKnown, why database is not set from dsn configuration ?
i will have the other problems if I want to change database, because database of login (management user, setting auth, and etc) and database of transaction is diffrent.
I made sure, this statement not in comment
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
but, i can find the debug, maybe because nginx ?
+1 have same problem
$dbh = new \PDO("dblib:host=xxxxxx;dbname=xxxxx", 'xxx', 'xxxxx');
$query = $dbh->prepare("SELECT * FROM xxxxx");
$query->execute();
$result = $query->fetchAll();
var_dump($result);
} catch (PDOException $e) {
echo $e->getMessage();
}
i try with this script is work, i can connect and got result of table.
this problem maybe on db handler for sql serve 2000, in yii1 I can connect my database successfully.
OS : centos7 64 bit DB : SQL Server 2014 64 bit server : nginx 1.8
I have problem to connect yii2 to sql server I just use module user-management standard of extension yii2, and I had try this project on windows well. my db.php
PHP.ini
/etc/freetds.conf
/etc/odbc.ini (I created this file manual, not from instalation)
/etc/odbcinst.ini
When I Login in web, SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (127.0.0.1) (severity 9) what should I do ?