2023-05-24

Бүх баазаа нэгэн зэрэг - Export and Import all databases at one time MySQL

All the answers I see on this question can have problems with the character sets in some databases due to the problem of redirecting the exit of mysqldump to a file within the shell operator >.


To solve this problem you should do the backup with this command line. The -r flag does the same as the shell operator > but without the character-set problems.


mysqldump -u root -p --opt --all-databases -r alldb.sql

or

mysqldump.exe --all-databases > alldb.sql

To do a good BD restore without any problem with character sets use these commands (you can change the default-character-set as you need).


cmd

mysql -uroot -p --default-character-set=utf8

mysql> SET names 'utf8';

mysql> SOURCE alldb.sql;

No comments:

Post a Comment

aapanel php 7.4 oci8 суулгах/install [ubuntu 22.04]

          oci8 суулгах/install [aapanel ubuntu 22.04]   php 7.4 суулгаж тохируулсан байгаа хэрэв aapanel-ийм бус system php суусан байвал ус...