Jump to content

export of UTF database on windows


anatak

Recommended Posts

Hello

I am using Easyphp to develop my site.

I wanted to export my database and then rename it in the text file and run the query (basically I wanted a copy of my database with a different name)

The problem is that the export file is saved as a .sql file and when I open it with notepad and change I lose all the data in Japanese (utf encoded).

Even saving the file as UTF in Notepad did not change that.

 

This may sound stupid but does anybody know a free editor that I could use to open and edit an exported file ?

Or maybe there is another way ?

Is it possible to export / backup a mysql database using binary format ?

 

thanks

anatak

Link to comment
https://forums.phpfreaks.com/topic/39708-export-of-utf-database-on-windows/
Share on other sites

The dump of the database doesn't need to have the chosen database as part of its content. If you're using the "--databases" option then you can remove that and only use the "--opt" option. The sql file will then only include the table creation information and you can import the file into any database you choose.

 

mysqldump --opt dbname > file.sql
mysql dbname < file.sql

 

--opt              Same as --add-drop-table, --add-locks, --create-options,

                      --quick, --extended-insert, --lock-tables, --set-charset,

                      and --disable-keys. Enabled by default, disable with

                      --skip-opt.

 

I don't know if it has always been enabled by default but it's an option I've always explicitly used.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.