3

I want to import the large database using command prompt in MAC. I have seen similar question answered.(Youtube Link: https://www.youtube.com/watch?v=9clyBrkclQ8 )

From the MySQL console:

mysql> use DATABASE_NAME;
mysql> source path/to/file.sql;

But recently I have started using MAC; I have looked around for the solution to do the same in MAC but did not find anything. Has anyone tried to do this on MAC? Thanks for the help.

1 Answer 1

0

If you execute the following command in the terminal it should do the job.

mysql -p -u USERNAME DATABASE < SQLFILE.sql
Sign up to request clarification or add additional context in comments.

4 Comments

When I use this command I get the following output: mysql Ver 15.1 Distrib 10.1.16-MariaDB, for Win32 (AMD64) Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Usage: mysql [OPTIONS] [database] Default options are read from the following files in the given order: C:\Windows\my.ini C:\Windows\my.cnf C:\my.ini C:\my.cnf C:\xampp\mysql\my.ini C: \xampp\mysql\my.cnf C:\xampp\mysql\bin\my.ini C:\xampp\mysql\bin\my.cnf The following groups are read: mysql client client-server client-mariadb The following options may be given as the first argument:
It looks like you are using windows terminal. You may try this: cmd.exe /c "mysql -u USERNAME -p DATABASE < SQLFILE.sql" and don't forget to set the complete path to the file.
what fuck is that where is full path? how is it possible if someone put the above command in cmd will work, no way it's will not work
how is it possible if someone put the above command in cmd you think it will work! no way it's will not work........... if someone new and they have no idea about complete path how they will understand your answer, if want to help some then please give him detailed answer............................................................................................................... like this macbook$ /Applications/XAMPP/xamppfiles/bin/mysql -p -u USERNAME DATABASE < SQLFILE.sql

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.