I've forgotten my MySQL owner details. I need a way to find my username. My password will not be a problem. I use Ubuntu 12.04 Linux, and would prefer a command line solution.
Thank you in advance.
Well, then you have a clear way to restore it:
Run query
SELECT DISTINCT user FROM mysql.user
That's it - you have a list of users. Save it somewhere, then run server normally and try your user names one by one.
Tip: if you want to reset root password, there's a corresponding manual page.