0
votes

I saw everything about this topic on Stack Overflow but nothing really solved my issue.

I migrated an app made on cakephp from a linux machine to a w7 machine. I'm not a programmer so I'm not familiar with this kind of thing. Btw, I installed xamp on this new machine, imported everything but on running in localhost one part of the app display this error.

Warning (2): mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) [CORE\cake\libs\model\datasources\dbo\dbo_mysql.php, line 370]
Warning (2): mysql_select_db(): supplied argument is not a valid MySQL-Link resource [CORE\cake\libs\model\datasources\dbo\dbo_mysql.php, line 375]
Warning (2): mysql_get_server_info(): supplied argument is not a valid MySQL-Link resource [CORE\cake\libs\model\datasources\dbo\dbo_mysql.php, line 383]
Warning (2): mysql_query(): supplied argument is not a valid MySQL-Link resource [CORE\cake\libs\model\datasources\dbo\dbo_mysql.php, line 407]

Missing Database Table

Error: Database table jobs for model Job was not found.

Notice: If you want to customize this error message, create app\views\errors\missing_table.ctp``

I've done a new installation of phpmyadmin to manage my db, I've imported the previous tables and so on, but the error is still there. That's not a problem of plural terms, or missing tables, table is there with the exact name in the exact db!

Model name-->job.php controller --> jobs_controller.php

This is my database.php code:

class DATABASE_CONFIG {

    var $default = array(
        'driver' => 'mysql',
        'persistent' => false,
        'host' => 'localhost',
        'login' => 'root',
        'password' => 'password',
        'database' => 'seo',
        'prefix' => '',
    );

    var $test = array(
        'driver' => 'mysql',
        'persistent' => false,
        'host' => 'localhost',
        'login' => 'user',
        'password' => 'password',
        'database' => 'test_database_name',
        'prefix' => '',
    );
}
?>

Cache is clean.

This is the .htaccess (may this could block phpmyadmin connection)

<IfModule mod_rewrite.c>
   RewriteEngine on
   Rewriterule ^phpmyadmin/.*$ - [PT]
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

I'm really stuck with this, sorry for my length.

I would really appreciate your help.

1
did you set the right password for the BD user?arilia
Well that's the problem. I'm not sure how could i do that. i've imported this sql file on phpmyadmin: CREATE USER 'root'@'localhost'; SET PASSWORD FOR 'root'@'localhost' = PASSWORD( 'xxx' ); GRANT ALL PRIVILEGES ON seo . * TO 'root'@'localhost' WITH GRANT OPTION ;nuanda
set the password correctly for the user root, and make sure the user has the correct priveledges to access the databaseColonel Mustard

1 Answers

0
votes

Try whit password empty

class DATABASE_CONFIG {

var $default = array(
    'driver' => 'mysql',
    'persistent' => false,
    'host' => 'localhost',
    'login' => 'root',
    'password' => '',
    'database' => 'seo',
    'prefix' => '',
);

var $test = array(
    'driver' => 'mysql',
    'persistent' => false,
    'host' => 'localhost',
    'login' => 'user',
    'password' => '',
    'database' => 'test_database_name',
    'prefix' => '',
);

} ?>