# Cannot connect to mysql

**URL:** <https://discourse.diesel.rs/t/cannot-connect-to-mysql/210>\
**Category:** Uncategorized\
**Created:** [December 26, 2020, 12:27am UTC](https://discourse.diesel.rs/t/cannot-connect-to-mysql/210 "2020-12-26T00:27:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sara110](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@sara110](https://discourse.diesel.rs/u/sara110)\
**Post date:** [December 26, 2020, 12:27am UTC](https://discourse.diesel.rs/t/cannot-connect-to-mysql/210/1 "2020-12-26T00:27:03Z")

</div>

Hello,  
I am new to Rustc. I just followed one of your examples to connect to mysql but it failed.

I receive the following error. I am using eclipse as IDE and Rustc and Diesel has been installed  
Compiling myproject v0.1.0 (/xxx/Projects\_Rust/myproject)  
error[E0433]: failed to resolve: use of undeclared type `PgConnection`  
–\> src/lib.rs:17:5  
|  
17 | PgConnection::establish(&database\_url)  
| ^^^^^^^^^^^^ use of undeclared type `PgConnection`

can anybody help here. thanks

---

<div class="post-metadata">

**Author:** ![weiznich](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.diesel.rs/weiznich/32/64_2.png) [@weiznich](https://discourse.diesel.rs/u/weiznich)\
**Post date:** [January 4, 2021, 9:34am UTC](https://discourse.diesel.rs/t/cannot-connect-to-mysql/210/2 "2021-01-04T09:34:12Z")

</div>

If you want to connect to a mysql database you need to use the corresponding connection type. As the name and the documentation implies `PgConnection` is not the correct type. You are looking for `MysqlConnection`.
