-2

I'm unable to export my database. I have tried several times unsuccessfully including:

mysqldump -u root -p --opt --db_2 -r backup.sql;

and

mysqldump --database --user=root --password db_2 > export_into_db.sql;

I get this error with both of them:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqldump --database --user=root --password db_2 > export_into_db.sql' at line 1

mayersdesign
  • 5,062
  • 4
  • 35
  • 47
DaAmidza
  • 336
  • 2
  • 7
  • 25

1 Answers1

-1

For anyone who is using mac you need to do the following steps in order to export the sql:

1.open a new terminal window
2.type this to enter the mysql if your unable to enter it PATH=$PATH:/usr/local/mysql/bin
3.mysqldump -u root -p db_2 >/Users/your_name/Desktop/sql.sql;
4.type password 
DaAmidza
  • 336
  • 2
  • 7
  • 25