Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
Former Member
5 years ago[26] Dotenv from file broke in 2.0x
I've tried following this exactly on a few builds in 2.0x but it seems it's broke:
https://developer.1password.com/docs/cli/guides/environment-variables/#option-2-env-dotenv-file
[ERROR] 2021/...
Former Member
5 years agoHey @chrisgoffinet
I would be happy to offer some assistance.
I've just tested using the .env file as per the examples:
```
pre-req: a Database item titled "mysql" in a vault called "prod" with the database, username, and password fields filled out
create .env file and add the 3 secrets to it from the example
touch .env
echo "MYSQL_DATABASE = op://prod/mysql/database" >> .env
echo "MYSQL_USERNAME = op://prod/mysql/username" >> .env
echo "MYSQL_PASSWORD = op://prod/mysql/password" >> .env
run op run to see if it can print the secrets
op run --dotenv --no-masking -- printenv MYSQL_DATABASE
```
And it is working correctly for me on the beta-7 version.
Could you provide an example similar to one of the lines in your .env file?