如何在Agile Toolkit中爲mysql連接設置端口號?我的本地機器上的mysql運行在不同的端口3307,我的連接配置應該如何?在敏捷工具包中設置mysql端口號
我嘗試以下,但它沒有工作,
$config['dsn']='mysql://atk:[email protected]:3307/atk';
當我嘗試一個分貝測試,我收到以下錯誤,
C:\xampp\htdocs\atk4.1.2\atk4\lib\DBlite/mysql.php:40 [2] mysql_pconnect() [function.mysql-pconnect]: [2002] No connection could be made because the target machine actively refused it. (trying to connect via tcp://localhost:3306)
C:\xampp\htdocs\atk4.1.2\atk4\lib\DBlite/mysql.php:40 [2] mysql_pconnect() [function.mysql-pconnect]: No connection could be made because the target machine actively refused it.
SQLException
Database connection failed
MySQL error:
No connection could be made because the target machine actively refused it.
C:\xampp\htdocs\atk4.1.2\atk4\lib\BaseException.php:37
Stack trace:
C:\xampp\htdocs\atk4.1.2\atk4\lib/BaseException.php :37 SQLException BaseException->collectBasicData(Null, 1, 0)
C:\xampp\htdocs\atk4.1.2\atk4\lib/SQLException.php :45 SQLException BaseException->__construct("<p>Database connection failed</p><b>MySQL error:</b> <div style='border: 1px solid black'><font color=red>No connection could be...", Null, 1)
C:\xampp\htdocs\atk4.1.2\atk4\lib/DBlite.php :359 SQLException SQLException->__construct(Null, "Database connection failed")
C:\xampp\htdocs\atk4.1.2\atk4\lib/DBlite.php :101 gift_project DBlite->fatal("Database connection failed", True)
C:\xampp\htdocs\atk4.1.2\atk4\lib/ApiCLI.php :276 gift_project DBlite->connect(Array(7))
C:\xampp\htdocs\atk4.1.2\page/dbtest.php :7 gift_project ApiCLI->dbConnect()
C:\xampp\htdocs\atk4.1.2\atk4\lib/AbstractObject.php :129 gift_project_dbtest page_dbtest->init()
C:\xampp\htdocs\atk4.1.2\atk4\lib/ApiFrontend.php :90 gift_project AbstractObject->add("page_dbtest", "dbtest", "Content")
C:\xampp\htdocs\atk4.1.2\atk4\lib/ApiWeb.php :305 gift_project ApiFrontend->layout_Content()
C:\xampp\htdocs\atk4.1.2\atk4\lib/ApiWeb.php :297 gift_project ApiWeb->addLayout("Content")
C:\xampp\htdocs\atk4.1.2\atk4\lib/ApiWeb.php :182 gift_project ApiWeb->initLayout()
C:\xampp\htdocs\atk4.1.2/index.php :15 gift_project ApiWeb->main()
解決方法:以下類型的配置作品,
$config['dsn']=array('type'=>'mysql',
'hostspec'=>'localhost:3307',
'username'=>'atk',
'password'=>'password',
'database'=>'atk',
'charset'=>'utf-8');
我認爲這是一個錯誤。我將在即將到來的4.1.3中解決它。 同時,您是否嘗試過以陣列格式傳遞DSN? – romaninsh
@romaninsh我很抱歉,我沒有嘗試。我該怎麼做? – Abhishek
它在這裏簡要提到:http://agiletoolkit.org/learn/install/db – romaninsh