0

I need to backup MySQL tables that I have created in all my projects.

So far I have attempted to copy 1 table - hi5:

C:\ xcopy "c:\ProgramData\MySQL Server 5.7\Data\hi5" c:\MybackUp\

but it is not copied and the error message is Parse Error

Hope someone can tell me the proper way to do it. Tks.

Just to add, I have problem in connecting to MYSQL after including a except Default UTF-8 line in my.ini. So I can only do it via the Windows 10 command prompt method.

My purpose is to uninstall the problematic MYSQL and re-install a new version. So I need to save up all these tables I have created.

  • You should use mysqldump. – Aulis Ronkainen Oct 16 '18 at 3:15
  • Karen - mysqldump -u <username> -p<Password> -h 127.0.0.1 --routines --databases databasename > databasename.sql.... give this one a try and see if it allow connection from host 127.0.0.1 rather than localhost? Typically for the root account, you cannot connect to MySQL remotely so be sure you are connecting from the local server as root. If that does not work, tell me what error message it is giving you exactly. – Drink Some Pimp Juice IT Oct 17 '18 at 13:04
1

You can use the mysqldump program to export data to various formats using the command line. To be able to export all tables of all databases, you could use the --all-databases switch like this:

shell> mysqldump --all-databases > dump.sql
  • I can't. It gives me the same error 2003: can't connect to MYSQL server on localhost(10061) when trying to connect – Karen Goh Oct 16 '18 at 8:55
0

This problem may occur if MySQL is not running in the default port 3306.

To find which port the MySQL server is running on, use the following command in the MySQL command line client:

SHOW GLOBAL VARIABLES LIKE 'PORT';

Once you know the port, the dump command may look like this :

"C:\path\bin\mysqldump.exe" --user=root --password=mypassword --host=localhost --port=<port> --all-databases > "C:\path\dump.sql"

If this doesn't work, please include the full error message.

Look up the documentation for mysqldump.

  • I confirmed my local port is 3306. mysql-installer Information: 10 : Advancing to next step using: Service Name: MySQL57 Enable TCP/IP: True Port: 3306 Enable pipe: False Pipe name: MYSQL – Karen Goh Oct 17 '18 at 1:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.