Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 11
    This also jeopardizes your password security. Note that there is the MYSQL_PWD environment variable which is read by mysql if you don't specify -p. And under Linux this is a secure method because the environment of a user cannot be read by other unprivilleged users - in contrast to the argument vector. Commented Jul 14, 2019 at 14:55
  • You also can't trust environment variables to be secure, but it's better than providing it as an argument. Moreover, use of MYSQL_PWD is deprecated from MySQL 8.0 forward. Commented Sep 21, 2022 at 10:55