Note that there are some explanatory texts on larger screens.

plurals
  1. POcake bake console error:Database connection missing
    primarykey
    data
    text
    <p>I baked an application using console and from URL everything seems ok. But when i want to bake a model inside the application folder, I get an error:</p> <pre><code> Error: Database connection "Mysql" is missing, or could not be created. #0 /opt/lampp/cake/lib/Cake/Model/ConnectionManager.php(98): DboSource-&gt;__construct(Array) #1 /opt/lampp/cake/lib/Cake/Console/Command/Task/ModelTask.php(837): ConnectionManager::getDataSource('default') #2 /opt/lampp/cake/lib/Cake/Console/Command/Task/ModelTask.php(782): ModelTask-&gt;getAllTables(NULL) #3 /opt/lampp/cake/lib/Cake/Console/Command/Task/ModelTask.php(863): ModelTask-&gt;listAll(NULL) #4 /opt/lampp/cake/lib/Cake/Console/Command/Task/ModelTask.php(186): ModelTask-&gt;getName() #5 /opt/lampp/cake/lib/Cake/Console/Command/Task/ModelTask.php(84): ModelTask-&gt;_interactive() #6 /opt/lampp/cake/lib/Cake/Console/Command/BakeShell.php(102): ModelTask-&gt;execute() #7 /opt/lampp/cake/lib/Cake/Console/Shell.php(375): BakeShell-&gt;main() #8 /opt/lampp/cake/lib/Cake/Console/ShellDispatcher.php(177): Shell-&gt;runCommand(NULL, Array) #9 /opt/lampp/cake/lib/Cake/Console/ShellDispatcher.php(69): ShellDispatcher-&gt;dispatch() #10 /opt/lampp/cake/lib/Cake/Console/cake.php(24): ShellDispatcher::run(Array) #11 {main} </code></pre> <p>This is what I have in my opt/lampp/htdocs/cakapp/Confg/database.php</p> <pre><code> &lt;?php class DATABASE_CONFIG { public $default = array( 'datasource' =&gt; 'Database/Mysql', 'persistent' =&gt; false, 'host' =&gt; '127.0.0.1', 'login' =&gt; 'root', 'password' =&gt; 'alpha', 'database' =&gt; 'cakedb', ); } </code></pre> <p>my php --ini return:</p> <pre><code> Configuration File (php.ini) Path: /etc/php5/cli Loaded Configuration File: /etc/php5/cli/php.ini Scan for additional .ini files in: /etc/php5/cli/conf.d Additional .ini files parsed: /etc/php5/cli/conf.d/pdo.ini </code></pre> <p>while phpinfo() give me this path:</p> <pre><code> Configuration File (php.ini) Path: /opt/lampp/etc Loaded Configuration File :/opt/lampp/etc/php.ini </code></pre> <p>Isnt there a contradiction in the above two outputs? I mean php --ini is supposed to outputting the php.ini of the xampp not the other one, how can i make it point at the xampp's php.ini? I tried to change it by changing .bashrc with this line, no help ofcourse</p> <pre><code> export PATH=/opt/lampp/bin:$PATH </code></pre> <p>I tried to add this line to the database.configuration file: 'port' => '/opt/lampp/var/mysql/mysql.sock' But it didnt help.</p> <p>I did find some similar problems but they are either for windows for mac osx nothing for ubuntu.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload