how to emulate "su mysql" in ubuntu?

Dotan Cohen dotancohen at
Wed Jul 28 20:36:47 UTC 2010

On Wed, Jul 28, 2010 at 18:56, Patrick Doyle <wpdster at> wrote:
> I see that sudo takes a -u argument, perhaps
> $ sudo -u mysql /bin/sh
> might do the trick.

That's probably (untested, from memory):

$ mysql -u USERNAME -p

The USERNAME is not your Linux username, but a configured MySQL user.
The -p option means "using passowrd" and MySQL will prompt for it. If
you don't have a password then you probably don't have a user, so log
in like this:
$ mysql -u root

Dotan Cohen

More information about the ubuntu-users mailing list