Got error: 1045: Access denied for user 'root

gvh

Verified User
Joined
May 14, 2010
Messages
37
hello this is my problem

when I full backup , this error looks
Code:
Error while backing up database tunak_db
Error while backing up database tunak_db: The sql file is 0 bytes in size: /home/tunak/backups/backup/ifede_db.sql
mysqldump error output: mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect
Code:
mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect

http://www.directadmin.com/forum/showthread.php?t=37587


http://www.directadmin.com/forum/newthread.php?do=newthread&f=38

I tried all of them did not work

I cant solve this problem can you help me

thank you
 
Try this command for optimize and repair all databases

Code:
/usr/bin/mysqlcheck -uda_admin -p`grep "^passwd=" /usr/local/directadmin/conf/mysql.conf | cut -d= -f2` --auto-repair --check --optimize --all-databases

Regards
 
not solved

mysqldump error output: mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect
 
i still dont get why use root for make backups... is not supposed to as i know.. he should do using da_admin access to mysql...

Honestly ive no idea, maybe someone else will have much better ideas.

Regards
 
Hello,

DirectAdmin will use the user/pass from:
/usr/local/directadmin/conf/mysql.conf

The user there is usually da_admin, and not root.

What usually happens for the error you've posted, since we run mysqldump as root, is that if there is a file:
/root/.my.cnf

this will override our settings and use that .my.cnf instead.
Check to see if you have /root/.my.cnf and remove it if you do.

Also check /etc/my.cnf to see if any user/pass settings are preset, as there should not be any.

Lastly, check your system for any other my.cnf file you have.. There should only be 2:
/etc/my.cnf (ours, pending it's contents)
/usr/local/directadmin/conf/my.cnf

Any others, eg:
/etc/mysql/my.cnf

should not exist.
http://help.directadmin.com/item.php?id=329

John
 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' in mysqlcheck

Try this command for optimize and repair all databases

Code:
/usr/bin/mysqlcheck -uda_admin -p`grep "^passwd=" /usr/local/directadmin/conf/mysql.conf | cut -d= -f2` --auto-repair --check --optimize --all-databases

Regards

thank you SeLLeRoNe .
mysqlcheck -uda_admin -p`grep "^passwd=" /usr/local/directadmin/conf/mysql.conf | cut -d= -f2` --auto-repair --check --optimize --all-databases is worked without "/usr/bin/"

 
Fix error 1045: User Access Denied

You may across error #1045 Access Denied for user ‘root’@’localhost’ when yu try to access phpMyAdmin after complete installation of local host server. Main reason for this reason to take place is when the local host is not assigned with complete accessing authority or may be the password that is facilitated is incorrect.

In order to solve this error you can try doing as follows:

Step 1: Open MySQL console

Step 2: Set Password= PASSWORD (Enter Your Password Here)

Where User=”root”

Replace your password with your chosen password
Hit Enter
Wash out the Priviliges

Step 3: Open config.inc.php file situated in files of local server and edit it.

Make use of a text editor like Notepa++ to open config.inc.php file.

Switch to My Computer> C Drive> (Folder Of Local Server MAMP/XAMPP/WAMP)> APPS> PHPMYADMIN> Config.inc.php

Locate this line of code: $cfg [‘Servers’][$i][‘password’] = “; //MySQL password
Make alteration with the freshly created password from step 2 and save it

Step 4: Access phpMyAdmin

If above affirmed solution does not help you to get rid of error code 1045 then best option accessible is SQL Repair Tool that’s most reliable tool in order to fix error 1045 user access denied. It also recovers corrupted and damaged database files without backup and recovers stored procedures, views, indexes, tables, unique/primary keys, etc from damaged SQL database.
 
Back
Top