# I have a credential with a dollar sign and I suspect it ruins the connection string

**URL:** <https://discourse.greatexpectations.io/t/i-have-a-credential-with-a-dollar-sign-and-i-suspect-it-ruins-the-connection-string/1655>\
**Category:** GX Core Support\
**Tags:** help-wanted\
**Created:** [March 6, 2024, 8:09pm UTC](https://discourse.greatexpectations.io/t/i-have-a-credential-with-a-dollar-sign-and-i-suspect-it-ruins-the-connection-string/1655 "2024-03-06T20:09:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![isaactietz](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.greatexpectations.io/isaactietz/32/286_2.png) [@isaactietz](https://discourse.greatexpectations.io/u/isaactietz)\
**Post date:** [March 6, 2024, 8:09pm UTC](https://discourse.greatexpectations.io/t/i-have-a-credential-with-a-dollar-sign-and-i-suspect-it-ruins-the-connection-string/1655/1 "2024-03-06T20:09:13Z")

</div>

I am using mssql+pyodbc to form a connection string in order to connect to a database. However a credential to our database contains a dollar sign and I believe it throws an error because the error says whatever the string of characters after the dollar sign in the credentials is a missing variable.

```auto
password = 'pass$word1234'
drivers = [item for item in pyodbc.drivers() if item.endswith(' for SQL Server')]
if drivers:
    driver = drivers[0]
else:
    raise Exception("No drivers available")

connection_string = f"mssql+pyodbc://{username}:{password}@{server}/{database}?driver={driver}&charset=utf&autocommit=true"

```

 ![Screenshot 2024-03-06 at 2.09.40 PM](https://canada1.discourse-cdn.com/flex031/uploads/greatexpectations/original/1X/15caffe3f813d5ae117d42eb5032c05e41d82dd7.png)

Hardcoding the password in the string has the same result.  
sqlalchemy is installed, and adding a backslash causes an authentication issue.  
I have a separate connection in a different project via pyodbc.connect using the same credentials with no backslash that can connect.  
Using a different set of credentials without a dollar sign _does_ work.

EDIT: It seems this used to be an issue in the legacy version [https://github.com/great-expectations/great\_expectations/issues/1927](https://github.com/great-expectations/great_expectations/issues/1927)

---

<div class="post-metadata">

**Author:** ![slack\_user](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.greatexpectations.io/slack_user/32/202_2.png) [@slack\_user](https://discourse.greatexpectations.io/u/slack_user)\
**Post date:** [March 6, 2024, 8:24pm UTC](https://discourse.greatexpectations.io/t/i-have-a-credential-with-a-dollar-sign-and-i-suspect-it-ruins-the-connection-string/1655/2 "2024-03-06T20:24:52Z")

</div>

Try `password = 'pass\\$word1234'`. I just had the same issue  
Note: `@Matt Allen` originally [posted this reply in Slack](https://greatexpectationstalk.slack.com/archives/CUTCNHN82/p1709756682336639?thread_ts=1709755777.688459&cid=CUTCNHN82). It might not have transferred perfectly.

---

<div class="post-metadata">

**Author:** ![isaactietz](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.greatexpectations.io/isaactietz/32/286_2.png) [@isaactietz](https://discourse.greatexpectations.io/u/isaactietz)\
**Post date:** [March 6, 2024, 8:36pm UTC](https://discourse.greatexpectations.io/t/i-have-a-credential-with-a-dollar-sign-and-i-suspect-it-ruins-the-connection-string/1655/3 "2024-03-06T20:36:37Z")

</div>

Yeah unfortunately using a backslash or double backslash results in `pass\$word1234`  
I printed the connection string when using a double or single backslash and it always contains a single backslash in the connection string, which then causes a 28000 pyodbc error.

 ![Screenshot 2024-03-06 at 2.35.50 PM](https://canada1.discourse-cdn.com/flex031/uploads/greatexpectations/original/1X/d32cfd7e82fcfd300b947c89d976bd3681f38e64.png)

---

<div class="post-metadata">

**Author:** ![slack\_user](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.greatexpectations.io/slack_user/32/202_2.png) [@slack\_user](https://discourse.greatexpectations.io/u/slack_user)\
**Post date:** [March 7, 2024, 4:08pm UTC](https://discourse.greatexpectations.io/t/i-have-a-credential-with-a-dollar-sign-and-i-suspect-it-ruins-the-connection-string/1655/4 "2024-03-07T16:08:13Z")

</div>

Interesting, it’s working for me with a postgres connection string, I wonder what the difference is  
Note: `@Matt Allen` originally [posted this reply in Slack](https://greatexpectationstalk.slack.com/archives/CUTCNHN82/p1709827684870739?thread_ts=1709755777.688459&cid=CUTCNHN82). It might not have transferred perfectly.
