Welcome Guest, Not a member yet? Register   Sign In
MySQL access denied - even if the user has all privileges
#1

[eluser]Andreas Krohn[/eluser]
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

[eluser]asim111[/eluser]
can you show me your config/database.php file?


Code:
$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

[eluser]Rey Philip Regis[/eluser]
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.

Code:
$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

[eluser]asim111[/eluser]
See your error message:

Quote: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




Theme © iAndrew 2016 - Forum software by © MyBB