# trying to startup mysql server for the first time getting Unable to create temporary file; errno: 2

**URL:** <https://forums.percona.com/t/trying-to-startup-mysql-server-for-the-first-time-getting-unable-to-create-temporary-file-errno-2/7905>\
**Category:** Percona Server for MySQL\
**Created:** [August 13, 2020, 4:00pm UTC](https://forums.percona.com/t/trying-to-startup-mysql-server-for-the-first-time-getting-unable-to-create-temporary-file-errno-2/7905 "2020-08-13T16:00:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ipcmlr](https://avatars.discourse-cdn.com/v4/letter/i/df705f/32.png) [@ipcmlr](https://forums.percona.com/u/ipcmlr)\
**Post date:** [August 13, 2020, 4:00pm UTC](https://forums.percona.com/t/trying-to-startup-mysql-server-for-the-first-time-getting-unable-to-create-temporary-file-errno-2/7905/1 "2020-08-13T16:00:25Z")

</div>

I’m trying to startup the mysql server for the first time.  
I’m using a config file i used for version 5.7  
I’m on centos 7.8.2003  
  
I cannot startup and am getting:&nbsp;Unable to create temporary file; errno: 2  
And its not telling me where its trying to create the temporary file. Its very generic.  
  
Below is a snippet of the error log:  
  
2020-08-13T17:17:32.451579-04:00 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.2020-08-13T17:17:32.451677-04:00 1 [Note] [MY-013546] [InnoDB] Atomic write enabled2020-08-13T17:17:32.451743-04:00 1 [Note] [MY-012274] [InnoDB] The first innodb\_system data file ‘ibdata1’ did not exist. A new tablespace will be created!2020-08-13T17:17:32.451810-04:00 1 [Note] [MY-012932] [InnoDB] PUNCH HOLE support available2020-08-13T17:17:32.451865-04:00 1 [Note] [MY-012943] [InnoDB] Mutexes and rw\_locks use GCC atomic builtins2020-08-13T17:17:32.451915-04:00 1 [Note] [MY-012944] [InnoDB] Uses event mutexes2020-08-13T17:17:32.451965-04:00 1 [Note] [MY-012945] [InnoDB] GCC builtin \_\_atomic\_thread\_fence() is used for memory barrier2020-08-13T17:17:32.452042-04:00 1 [Note] [MY-012948] [InnoDB] Compressed tables use zlib 1.2.112020-08-13T17:17:32.454062-04:00 1 [Note] [MY-013251] [InnoDB] Number of pools: 12020-08-13T17:17:32.454296-04:00 1 [Note] [MY-012951] [InnoDB] Using CPU crc32 instructions2020-08-13T17:17:32.454847-04:00 1 [Note] [MY-012203] [InnoDB] Directories to scan './'2020-08-13T17:17:32.455007-04:00 1 [Note] [MY-012204] [InnoDB] Scanning './'2020-08-13T17:17:32.455115-04:00 1 [Note] [MY-012208] [InnoDB] Completed space ID check of 0 files.2020-08-13T17:17:32.455211-04:00 1 [ERROR] [MY-012576] [InnoDB] Unable to create temporary file; errno: 22020-08-13T17:17:32.455288-04:00 1 [ERROR] [MY-012929] [InnoDB] InnoDB Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.2020-08-13T17:17:32.471618-04:00 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.2020-08-13T17:17:32.471736-04:00 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/data/ is unusable. You can remove all files that the server added to it.2020-08-13T17:17:32.471856-04:00 0 [ERROR] [MY-010119] [Server] Aborting2020-08-13T17:17:32.471893-04:00 0 [Note] [MY-010120] [Server] Binlog end2020-08-13T17:17:32.473157-04:00 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20-11)&nbsp; Percona Server (GPL), Release 11, Revision 5b5a5d2.

---

<div class="post-metadata">

**Author:** ![ipcmlr](https://avatars.discourse-cdn.com/v4/letter/i/df705f/32.png) [@ipcmlr](https://forums.percona.com/u/ipcmlr)\
**Post date:** [August 14, 2020, 8:56am UTC](https://forums.percona.com/t/trying-to-startup-mysql-server-for-the-first-time-getting-unable-to-create-temporary-file-errno-2/7905/2 "2020-08-14T08:56:55Z")

</div>

Ok. this was caused because my tempdir was inside my datadir and I could not startup a fresh install with a non empty datadir, so it was always missing.  
So this part has been resolved.
