A R
A R

Reputation: 510

How do I change the default MySQL user on OpenSuSE 13.1

How do I get the "mysql" command to open a connection to MySQL with the root user? I don't want to type mysql --user root, I want it to start immediately.

I have two machines: Mageia 3 and OpenSuSE 13.1. The Mageia machine does this exactly when I open a terminal as the normal user: it simply starts a mysql session and when I type SELECT USER(); it says "root@localhost".

The OpenSuSE machine tries to use the current bash user to connect to mysql instead of using root. How do I configure this behavior?

Upvotes: 0

Views: 71

Answers (2)

A R
A R

Reputation: 510

Although symcbean's solution works, I found it easier to create a user with the same name as the Linux account that is calling the command. Give this user enough privileges and voilà. This way avoids the problem mentioned by symcbean.

Upvotes: 0

symcbean
symcbean

Reputation: 48387

Specify a user option in the [client] section of ~/.my.cnf

...but generally its considered bad practice to use the admin account for normal use of a system.

Upvotes: 1

Related Questions