ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

MySQL access denied - even if the user has all privileges

December 02, 2008 5:03pm

Subscribe [3]
  • #1 / Dec 02, 2008 5:03pm

    Andreas Krohn

    21 posts

    I am in the process of setting up my development environment on a new Macbook and I am stuck with a MySQL problem. For some reason I can not get CodeIgniter to connect to my MySQL database, according to the CI logs the problem is: “Access denied for user ‘root’@‘localhost’ (using password: YES)”.

    The root user has complete privileges when I check the MySQL “user” table (and I have done GRANT ALL PRIVILEGES etc), and the password is correct. There is no problem logging in to the MySQL Query Browser etc with the root user on localhost. I do not know if it has anything to do with my CI problem, but for some reason I can not create schemas and tables etc in the Query Browser. Those options are simply disabled.

    If anybody has any pointers on what I can try to get past this I would greatly appreciate it, I am getting really frustrated fighting MySQL.

    /Andreas

  • #2 / Dec 02, 2008 6:01pm

    asim111

    11 posts

    can you show me your config/database.php file?

    $active_group = "default";
    $active_record = TRUE;
    
    $db['default']['hostname'] = "localhost";
    $db['default']['username'] = "root";
    $db['default']['password'] = "***************";
    $db['default']['database'] = "Db_Name";
    $db['default']['dbdriver'] = "mysql";
    $db['default']['dbprefix'] = "";
    $db['default']['pconnect'] = TRUE;
    $db['default']['db_debug'] = TRUE;
    $db['default']['cache_on'] = FALSE;
    $db['default']['cachedir'] = "";
    $db['default']['char_set'] = "utf8";
    $db['default']['dbcollat'] = "utf8_general_ci";
  • #3 / Dec 02, 2008 6:06pm

    Rey Philip Regis

    92 posts

    The default user and the most powerful user in MYSQL is the root user, and in a fresh install I know it has no password. Just like in my local server right now..So what you do is open your config.php and dont specify a password.

    $db['default']['hostname'] = "localhost";
    $db['default']['username'] = "root";
    $db['default']['password'] = ""; // no password
    $db['default']['database'] = "Db_Name";
    $db['default']['dbdriver'] = "mysql";
    $db['default']['dbprefix'] = "";
    $db['default']['pconnect'] = TRUE;
    $db['default']['db_debug'] = TRUE;
    $db['default']['cache_on'] = FALSE;
    $db['default']['cachedir'] = "";
    $db['default']['char_set'] = "utf8";
    $db['default']['dbcollat'] = "utf8_general_ci";

    Good day..

  • #4 / Dec 02, 2008 6:19pm

    asim111

    11 posts

    See your error message:

    Access denied for user ‘root’@‘localhost’ (using password: YES)”.

    using password: YES. it means password is not blank.

    ok try another thing. create a new user in mysql, assign previlliages and try that username and password.

    let me know is it working or not

    cheers

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases