Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysqldump

Status
Not open for further replies.

befortin

IS-IT--Management
Sep 21, 2004
48
CA
Hi,

I'm posting here cause this is not Gentoo related at all. I don't know anything about MySQL - but I'm running MySQL on a SUSE 9.3 box and I have to backup a database. It doesn't work :
=============================
# mysqldump --user root --password="My-Very-Long-Password" zabbix /tmp/dump.test
mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect
=============================

BUT I can connect to the database with the same password :
=============================
# mysql zabbix -p
// I enter My-Very-Long-Password here
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11756 to server version: 4.1.10a

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+----------+
| Database |
+----------+
| mysql |
| test |
| zabbix |
+----------+
3 rows in set (0.01 sec)
=============================

Anything I should try? What I'm I doing wrong??
 
In the first example you're connecting as user "root", in the second you're not. Try removing the "--user root" from the first example.
 
I see... I tried but it still doesn't work :

# mysqldump --password="my-password" zabbix > /tmp/test
mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect

I have also tried :
# mysqldump zabbix > /tmp/test
mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) when trying to connect

I guess the easiest would be to reset the root password and use mysqldump with the root user?
 
Well, I can backup the database using

mysqldump --user="root" -p zabbix > /tmp/database.dump

It asks for the password and then creates the file.


But I need to put this command in a script. When using

mysqldump --user="root" --password="my-password" zabbix > /tmp/database.dump

I get the "mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect" error.


Any other idea??
 
Try the option -pmy-password (note no space between -p and password) instead.
 
with -pmy-password, I still get the same error :

mysqldump --user="root" --pmy-password zabbix > /tmp/test.dump
mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect
 
And what about the option --password=<your password>?
 
right click the data folder - > copy and then paste where you want to backit up to

Binary Intelligence, true or false?
 
sorry meant to say if this is ok then you could put it in a script, just a bit more on your Problem connecting, you did say that you was new so I am going to ask a silly question. You are not trying to connect with your Linux root pass are you? Sorry if this was a silly question.

Binary Intelligence, true or false?
 
alcyone : I think that I already tried this. I will have to try again on Monday though.

litton1 : I'm looking to put this in a script, so I can't copy/paste... And I'm connecting with the MySQL root password (I'm able to use mysqldump with -p and no password specified. mysqldump asks me for a password then and it works - but I have to get the password in the command itself!)
 
alcyone : well I tried and it still doesn't work!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top