# Import from MySQL (/docs/prisma-postgres/import-from-existing-database-mysql) > For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL. Import an existing MySQL database into Prisma Postgres, then use it with Prisma ORM. Location: Prisma Postgres > Import from MySQL Move an existing MySQL database into Prisma Postgres, then connect Prisma ORM to it. ## Prerequisites [#prerequisites] You need: * the connection URL for the MySQL database you are importing from * a Prisma Data Platform account * `pgloader` * Node.js 22.18 or newer on the 22 line, 24.11 or newer on the 24 line, or 26 or newer (24 recommended) ## 1. Create a Prisma Postgres database [#1-create-a-prisma-postgres-database] Create a Prisma Postgres database from Console or with the CLI. Copy the direct connection string. You will use it for the import and for `DATABASE_URL`. ## 2. Create a pgloader config [#2-create-a-pgloader-config] Create `config.load`: ```text title="config.load" LOAD DATABASE FROM mysql://USER:PASSWORD@HOST:PORT/DATABASE INTO postgres://USER:PASSWORD@db.prisma.io:5432/?sslmode=require WITH quote identifiers, include drop, create tables, create indexes, reset sequences ALTER SCHEMA 'DATABASE' RENAME TO 'public'; ``` ## 3. Import into Prisma Postgres [#3-import-into-prisma-postgres] Run pgloader: ```shell pgloader config.load ``` ## 4. Add Prisma ORM [#4-add-prisma-orm] From your app root, initialize Prisma ORM: #### bun ```bash bunx prisma@latest orm init ``` #### pnpm ```bash pnpm dlx prisma@latest orm init ``` #### yarn ```bash yarn dlx prisma@latest orm init ``` #### npm ```bash npx prisma@latest orm init ``` Choose PostgreSQL, set `DATABASE_URL` to the Prisma Postgres connection string, then infer and emit the contract: #### bun ```bash bunx prisma contract infer --output ./prisma/contract.prisma bunx prisma contract emit bunx prisma db sign ``` #### pnpm ```bash pnpm prisma contract infer --output ./prisma/contract.prisma pnpm prisma contract emit pnpm prisma db sign ``` #### yarn ```bash yarn prisma contract infer --output ./prisma/contract.prisma yarn prisma contract emit yarn prisma db sign ``` #### npm ```bash npx prisma contract infer --output ./prisma/contract.prisma npx prisma contract emit npx prisma db sign ``` ## Next steps [#next-steps] * Review table and column names in the inferred contract. * Use [Add Prisma ORM to an existing PostgreSQL database](https://www.prisma.io/docs/prisma-orm/add-to-existing-project/postgresql) for the first Prisma ORM query. * Use the [full Prisma Postgres MySQL import guide](https://www.prisma.io/docs/prisma-postgres/import-from-existing-database-mysql) for deeper migration details. ## Related pages - [`From the CLI`](https://www.prisma.io/docs/prisma-postgres/from-the-cli): Start a Prisma ORM app with Prisma Postgres from the command line. - [`Import from PostgreSQL`](https://www.prisma.io/docs/prisma-postgres/import-from-existing-database-postgresql): Move an existing PostgreSQL database to Prisma Postgres without changing your ORM version.