0

I have a MYSQL database(db_mysql) whose data I want to transfer to another PostgreSQL database(db_psql) which is initially empty.

I tried using the command pgloader mysql://root@localhost/db_mysql pgsql:///db_psql from the terminal(also using sudo)

But I keep getting an error like this Failed to connect to mysql at "localhost" (port 3306) as user "root": MySQL Error [1045]: "Access denied for user 'root'@'localhost' (using password: NO)"

I suppose it requires mysql password but I am not sure where to provide it

1 Answer 1

1

use

 mysql://root:password@localhost/db_mysql pgsql:///db_psql
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for your reply. I tried it out and it seemed to have solved the MYSQL part of the error but now, I am getting an other error like ERROR Database error 42501: permission denied for db_psql QUERY: CREATE SCHEMA db_psql; FATAL Failed to create the schema, see above.
there is a similar syntax for postgrsql --> postgresql://[user[:password]@][netloc][:port]
Thanks a lot! The command worked and I was able to see the list of all tables,time taken to run the query, etc. But while I am connecting to the database and listing all tables in the postgresql shell, I am getting a message saying that 'No relations are found'. I am however sure that there are relations in the database because I am able to see the tables when I list them in MYSQL shell.
foreign keys are by default included look please here for all available options pgloader.readthedocs.io/en/latest/ref/mysql.html

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.