0

I'm a new MacBook Pro user. Because the file is so large, I need to import it from terminal.

I already know how to import and export MySQL data using terminal in Linux, but since I'm newbie in the iOS environment, I'm lost.

I think I'm missing something, maybe the path or anything, I just don't know.

I'm using XAMPP. I access my htdocs file from terminal, with this

cd /Applications/xampp/xamppfiles/htdocs/abcFolder

and then i try to import my db with this :

mysql -u root mir_existing < mirdb_21_november_2016\ \(1\).sql

Since I have no password, I remove the -p syntax.

But when I press enter to run the script, the result is command not found.

Many of you referred me to this page. How can I access the mysql command line tool when using XAMPP in OS X?

I already did it, but I don't know where to access my mysql file path to import the db. It's different.

For example. i need to run this script to import the db right?

mysql -u mysql_user -p DATABASE < backup.sql

for example, my backup.sql is on htdocs/abcFolder/backup.sql How can access it ?

Should I try this?

 mysql -u mysql_user -p DATABASE < htdocs/abcFolder/backup.sql

i already tried that thing. nothing happen. sigh.

enter image description here

How do I import my db?

4

1 Answer 1

0

If doing

which mysql

doesn't yield any results, you'll need to add the /path/to/mysql to your PATH variable and put it in your .bash_profile or .bashrc for future use so you don't have to keep adding it. After adding it to one of these files, just do

source .bash_profile

or

source .bashrc

depending on where you put it.

e.g. on one of my macs I use MAMP and need access to the bins it provides (mysql among them) so this is in my .bash_profile:

export PATH="$PATH:/Applications/MAMP/Library/bin"
Sign up to request clarification or add additional context in comments.

1 Comment

nothing happen. because i inside the mysql terminal. please see my thread. i attach the print screen. thanks

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.