mysqldump - debian

beetle

Verified User
Joined
Nov 19, 2003
Messages
26
Location
nethetlands
when i will try to make a mysqldump, i get only permission denied from admin or root account

i think i have to do it with mysql as user?????

but how can i do it as root as user, because i will make a backup script
 
You need to provide a username and password to MySQl for mysqldump.
da_admin has access to everything and its password can be found in /usr/local/directadmin/conf/mysql.conf
 
my mysql.conf gives

user=da_admin
passwd=VS*****K

i give following command



server:/home/admin# /usr/local/mysql-standard-4.1.10-pc-linux-gnu-i686/bin/mysqldump -A -a -c --add-drop-table -u da_admin --password=VS*****K > "/home/admin/database.sql"

but i get still an acces denied...

/usr/local/mysql-standard-4.1.10-pc-linux-gnu-i686/bin/mysqldump: Got error: 1045: Access denied for user 'da_admin'@'localhost' (using password: YES) when trying to connect

what i am doing wrong?
 
./mysqldump -uUSERNAME -pPASSWORD --all-databases > database_dump.sql

works just fine for me.
 
yes login as root, but is this wrong??

because my backupscript is even running as root?

now is give

./mysqldump -uda_admin -pVS*****K --all-databases > database_dump.sql but it still gives only access denied for user da_admin
 
Code:
mysql -uroot -p

Code:
GRANT ALL PRIVILEGES ON *.* TO da_admin@localhost IDENTIFIED BY 'newdapass' WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit

i get
Code:
Enter password:
ERROR 1045 (28000): Access denied for user 'da_admin'@'localhost' (using password: YES)
 
Try

/etc/init.d/mysql stop

/usr/bin/mysqld_safe --skip-grant-tables &

mysql -u root -p mysql
(When prompted for a password, just hit enter)

update user set password=password("newpassword") where user='root';

flush privileges;

quit

(restart mysql)
/etc/init.d/mysql restart
 
killall -9 mysqld_safe
killall -9 mysqld

/sbin/service mysqld stop

Code:
[root@server1 ~]# /usr/bin/mysqld_safe --skip-grant-tables &
[1] 7422
[root@server1 ~]# Starting mysqld daemon with databases from /var/lib/mysql
mysql -u root -p mysql
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.14-standard-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> quit
Bye
[root@server1 ~]# /sbin/service mysqld restart

/sbin/service mysqld restart



/usr/local/directadmin/conf/mysql.conf
(same new password)

=
Error connecting to MySQL: Access denied for user 'da_admin'@'localhost' (using password: YES)
 
Back
Top