# Mysql schema compatibility error when starting temporal service

**URL:** <https://community.temporal.io/t/mysql-schema-compatibility-error-when-starting-temporal-service/2117>\
**Category:** Community Support\
**Tags:** java-sdk, mysql\
**Created:** [May 12, 2021, 7:58am UTC](https://community.temporal.io/t/mysql-schema-compatibility-error-when-starting-temporal-service/2117 "2021-05-12T07:58:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yesadi](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@yesadi](https://community.temporal.io/u/yesadi)\
**Post date:** [May 12, 2021, 7:58am UTC](https://community.temporal.io/t/mysql-schema-compatibility-error-when-starting-temporal-service/2117/1 "2021-05-12T07:58:01Z")

</div>

Hi I have a setup of MySQL which I would like to use with temporal service. I do not have root access hence earlier was getting creating database temporal and temporal\_visibility errors. I fixed this by getting db created in sql. Now it works fine but I get following error in the end  
“ **Unable to start server. Error: sql schema version compatibility check failed: version mismatch for keyspace/database: “temporal”. Expected version: 1.5 cannot be greater than Actual version: 0.0** ”.  
I am not sure why i am getting this error. Following is the content of my **schema\_version** and **schema\_update\_history** table in **temporal db**.  
mysql\> select \* from schema\_version;  
±------------------±---------±---------------------------±-------------±-----------------------+  
| version\_partition | db\_name | creation\_time | curr\_version | min\_compatible\_version |  
±------------------±---------±---------------------------±-------------±-----------------------+  
| 0 | temporal | 2021-05-12 07:43:43.727355 | 0.0 | 0.0 |  
±------------------±---------±---------------------------±-------------±-----------------------+  
1 row in set (0.01 sec)

mysql\> select \* from schema\_update\_history  
 → ;  
±------------------±-----±------±---------------------------±----------------±-------------±------------±------------+  
| version\_partition | year | month | update\_time | description | manifest\_md5 | new\_version | old\_version |  
±------------------±-----±------±---------------------------±----------------±-------------±------------±------------+  
| 0 | 2021 | 5 | 2021-05-12 07:43:43.732558 | initial version | | 0.0 | 0 |  
±------------------±-----±------±---------------------------±----------------±-------------±------------±------------+

**As is visible the current\_version and new\_version are both 0.0**.  
Please help in solving this error.  
In the end I got “t **emporal-web | establishing insecure connection…**  
**temporal-web | temporal-web up and listening on port 8088** ”  
but when i try to see client I keep getting  
" **14 UNAVAILABLE: DNS resolution failed"**  
**" OperationalError: 14 UNAVAILABLE: DNS resolution failed**  
**temporal-web | at Object.exports.createStatusError (/usr/app/node\_modules/grpc/src/common.js:91:15)**  
**temporal-web | at Object.onReceiveStatus (/usr/app/node\_modules/grpc/src/client\_interceptors.js:1209:28)**  
**temporal-web | at InterceptingListener.\_callNext (/usr/app/node\_modules/grpc/src/client\_interceptors.js:568:42)**  
**temporal-web | at InterceptingListener.onReceiveStatus (/usr/app/node\_modules/grpc/src/client\_interceptors.js:618:8)**  
**temporal-web | at callback (/usr/app/node\_modules/grpc/src/client\_interceptors.js:847:24) {**  
**temporal-web | cause: Error: 14 UNAVAILABLE: DNS resolution failed"**  
Can someone point out what mistake am I making.

---

<div class="post-metadata">

**Author:** ![Wenquan\_Xing](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/wenquan_xing/32/362_2.png) [@Wenquan\_Xing](https://community.temporal.io/u/Wenquan_Xing)\
**Post date:** [May 12, 2021, 4:47pm UTC](https://community.temporal.io/t/mysql-schema-compatibility-error-when-starting-temporal-service/2117/2 "2021-05-12T16:47:38Z")

</div>

git clone [https://github.com/temporalio/temporal.git](https://github.com/temporalio/temporal.git)  
git checkout “the version you are using”, e.g. git checkout v1.9.2  
make bins

temporal-sql-tool -u temporal --pw temporal --db temporal update-schema -d ./schema/mysql/v57/temporal/versioned  
temporal-sql-tool -u temporal --pw temporal --db temporal\_visibility update-schema -d ./schema/mysql/v57/visibility/versioned

ref: [temporal/Makefile at v1.9.2 · temporalio/temporal · GitHub](https://github.com/temporalio/temporal/blob/v1.9.2/Makefile#L328-L329)

---

<div class="post-metadata">

**Author:** ![yesadi](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@yesadi](https://community.temporal.io/u/yesadi)\
**Post date:** [May 16, 2021, 10:39am UTC](https://community.temporal.io/t/mysql-schema-compatibility-error-when-starting-temporal-service/2117/3 "2021-05-16T10:39:16Z")

</div>

When I am using default config.  
` environment: - DB=mysql - DB_PORT=3306 - MYSQL_USER=root - MYSQL_PWD=root **- MYSQL_SEEDS=mysql** - DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml`  
No it was running fine. Can someone please answer which sql is used when seeds is provided as mysql. Where is temporal db created in this case when `seeds=mysql` is provided in yml config? I checked in localhost sql and couldn’t find temporal db.

---

<div class="post-metadata">

**Author:** ![Mike\_Hajj](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/mike_hajj/32/2079_2.png) [@Mike\_Hajj](https://community.temporal.io/u/Mike_Hajj)\
**Post date:** [May 20, 2022, 11:58am UTC](https://community.temporal.io/t/mysql-schema-compatibility-error-when-starting-temporal-service/2117/4 "2022-05-20T11:58:44Z")

</div>

I was reading the above and I am facing the same problem.  
I even tried the proposed solution and it didn’t work for me.  
Currently, I am on release branch v1.16.x

```auto
Unable to start server. Error: could not build arguments for function "go.temporal.io/server/common/pprof".
LifetimeHooks (/home/builder/temporal/common/pprof/fx.go:39): failed to build *pprof.PProfInitializerImpl: could not build arguments for function "go.temporal.io/server/common/pprof".
NewInitializer (/home/builder/temporal/common/pprof/pprof.go:56): failed to build *config.PProf: received non-nil error from function "go.temporal.io/server/temporal".
ServerOptionsProvider (/home/builder/temporal/temporal/fx.go:149): sql schema version compatibility check failed: version mismatch for keyspace/database: "temporal". 
Expected version: 1.8 cannot be greater than Actual version: 0.0

```

can someone help clarify what this issue is about ?

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [May 20, 2022, 2:44pm UTC](https://community.temporal.io/t/mysql-schema-compatibility-error-when-starting-temporal-service/2117/5 "2022-05-20T14:44:43Z")

</div>

Was the db schema initialized? You can reference [here](https://github.com/temporalio/temporal/blob/master/Makefile#L336) on this.

---

<div class="post-metadata">

**Author:** ![shiva0612](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/shiva0612/32/2152_2.png) [@shiva0612](https://community.temporal.io/u/shiva0612)\
**Post date:** [June 16, 2022, 9:30am UTC](https://community.temporal.io/t/mysql-schema-compatibility-error-when-starting-temporal-service/2117/6 "2022-06-16T09:30:18Z")

</div>

yes I have intialized the DB schema still getting the same error

---

<div class="post-metadata">

**Author:** ![yinbiao99](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/yinbiao99/32/4802_2.png) [@yinbiao99](https://community.temporal.io/u/yinbiao99)\
**Post date:** [January 25, 2024, 9:10am UTC](https://community.temporal.io/t/mysql-schema-compatibility-error-when-starting-temporal-service/2117/7 "2024-01-25T09:10:13Z")

</div>

./temporal-sql-tool --database temporal\_visibility create-database  
SQL\_DATABASE=temporal\_visibility ./temporal-sql-tool setup-schema -v 0.0

Don’t use 【SQL\_DATABASE=temporal\_visibility】  
Use 【./temporal-sql-tool --database temporal\_visibility setup-schema -v 0.0】
