For security reasons openSUSE is set up to prevent you logging into mysql from root. That doesn’t apply if you use mysqldump after su – as an ordinary user. So, and I’m not sufficiently conversant with cron to know how to do that, if you can set up a cron task under a user using su or sudo, I assume it would work.
I have a mysqldump job running from a root cron job and it works fine.
The thing to remember is that when you run any mysql program from an account, the default mysql user is the account user. You can override this with -u user. You don’t show your command or your setup so we have no idea what user you are meant to use.
This also means that you don’t have to run mysqldump as root but from any account, since the mysql accounts are separate from Linux login accounts.
BTW, the MySQL online manual shows various ways of providing the password for an non-interactive mysql program. Safest is to put it in a section of $HOME/.my.cnf and make sure the permissions of that are 0600 or 0400.
It was really stupid on my part… I didn’t supply I path to where I wanted my sql dump, and when testing I where in the folder I wanted it in. Cron/mysqldump as root worked out just fine, the sql dump was simply saved in my home account path.
I will definitely try to use $HOME/.my.cnf, now I supply the password in clear text with –p & -u