Created
March 2, 2025 20:47
-
-
Save mdimai666/c106071c093d611ba3e4421dfa99ee16 to your computer and use it in GitHub Desktop.
MySQL export to PSQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.\mysqldump.exe -u root --default-character-set=utf8 -N db_name --result-file=C:\Users\D\Downloads\pn_dump_3.sql --no-create-info --skip-set-charset --compatible=postgresql | |
//optional | |
Get-Content .\pn_dump_3.sql | Foreach-Object {$_.Replace("\'", ''')} | Set-Content .\pn_dump_3_apos.sql | |
& 'C:\Program Files\PostgreSQL\14\bin\psql.exe' -U postgres -f 'C:\Users\d\Downloads\pn_dump_3_apos.sql' db_name | |
//next in cmd; | |
SET PGCLIENTENCODING=utf-8 | |
"C:\Program Files\PostgreSQL\14\bin\psql.exe" -U postgres -f "C:\Users\d\Downloads\pn_dump_3_apos.sql" db_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment