Tell me, please, what is the error. Trying to export MySQL in this way.

 mysqldump -u name_userdb -p -h localhost name_base > dump.sql 

    2 answers 2

    For Windows:

     "C:\Program Files\MySQL\MySQL Server\bin\mysqldump.exe" --user=root --password="123" --database name_base >D:\arh\dump20130731.sql 

    Where:

    • name_base - the name of the exported database
    • D: \ arh \ dump20130731.sql - path and file name for saving the database

    For Linux:

     mysqldump --user=root --password="123" --database name_base >/home/username/arh/dump20130731.sql 

    If you need to import / export several databases in a single archive file, then simply list the database names separated by spaces, for example:

     mysqldump --user=root --password="123" --database name_base another_base >/home/username/arh/dump20130731.sql 
    • I use the first case for Linux, but it doesn’t work, which user should I specify with a password? - Sergey4590
    • What is it ... @ Sergey4590, if you need with full rights, then of course root . Starting with root_path> mysql.exe -u root -p [Enter] Enter password: (empty if no password is set) [Enter] Welcome ... That's it! We went with full rights and the creature that we want: dump, drop, beer. If the root password was set, then we write it at the entrance. - Deonis

    mysqldump --opt --user = USERNAME --password = PASSWORD DATABASE TABLENAME> TO BASE

    • Che is not that, I need to shove the database into the file, and not vice versa. - Sergey4590