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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backup newbie problem 1

Status
Not open for further replies.

tvrtko

Programmer
Nov 26, 2003
53
HR
I tried to backup my database with

mysqldump --opt mydb > mydb.sql

and I got the error message:

mysqldump: Got error: 1045: Access denied for user 'ODBC'@'localhost' (using pas
sword: NO) when trying to connect

Then I tried

mysqldump --opt --password mydb > mydb.sql

When I entered the password that I use to connect to MySql Command Line Client I got the error message

mysqldump: Got error: 1045: Access denied for user 'ODBC'@'localhost' (using pas
sword: YES) when trying to connect

Can somebody tell me what to do?

Thanks in advance.
 
are you on the same machine you normally connect from as user ODBC ?

mysql> use mysql;

mysql> select host from user where user='ODBC';

this will return the address the user ODBC is allowed to connect from.

if you are on the same network but a different machine, you can make this available by either adding another line to user or changing the host to xxx.xxx.xxx.%

after making any changes, you should exit mysql and run the command :
mysqladmin reload

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
I'm on the same machine.

After

mysql> select host from user where user='ODBC';

I got an empty set.

 
ODBC doesn't have any access rights then.

Use a user which does.

mysqldump -u username [optional -ppassword] .....

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Hi,

If it is not too late try this command:

C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump --add-drop-table --user root --password=uo7883 imc_qa > imc_qa.sql

Does anyone know how to backup a database using python MySQLdb package?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top