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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.