MySQL workbench gives an error during exporting - mysql

I want to export from my live server pc the databses for my web apps and site,but I get the following errors:
14:18:07 Dumping ct (all tables)
Running: mysqldump.exe --defaults-file="c:\users\admini~1\appdata\local\temp\tmphnpsqu.cnf" --user=root --host=localhost --protocol=tcp --port=3306 --default-character-set=utf8 --routines --skip-triggers "ct"
Error executing task: 'ascii' codec can't encode character u'\xe4' in position 6: ordinal not in range(128)
Error executing task [Error 32] The process cannot access the file because it is being used by another process: 'c:\users\admini~1\appdata\local\temp\tmphnpsqu.cnf'
14:18:08 Export of C:\Users\Administrator\Documents\dumps\Dump20210825 (2).sql has finished

Open the task manager (ctrl+alt+delete) then go to processes, look for the process that's using the file and end it. After this, try exporting your schema again.

Related

Convert and import sql file into postgresql

I want to migrate database from mysql to postgresql. So, first did the mysqldump with this command
mysqldump -u root -p --compatible=postgresql --default-character-set=utf8 databasename > output.sql
Then i upload the output.sql to host and import the sql file using below command
psql -U root -d databasename -f /home/test/output.sql
But i got error when i try to import
ERROR: syntax error at or near "KEY"
ERROR: syntax error at or near "UNLOCK"
ERROR: syntax error at or near "("
invalid command \n
invalid command \'></script>
invalid command \";s:2:
invalid command \',
invalid command \']
Query buffer reset (cleared).
The size of database that I dumped is 7.5gb.
The SQL used in MySQL and that used in Postgres are not one-to-one inter-compatible. You need a converter program for anything non-trivial.
From the documentation for --compatible:
This option does not guarantee compatibility with other servers.
In other words, it's only slightly more compatible.
There are commercial products like Navicat which can help do this for you automatically, or you can dump out all your MySQL data in a neutral format like XML, JSON or CSV and read it back in using some other tool.

Error 1305 when importing sql dump into mySQL Workbench

I am importing a sql dump file into MySQL workbench and keep getting the error below. Does this mean the rest of the file/records did not import or only the xxx.getRates portion did not?
Will I be missing records from it?
Does anyone know what might be causing this?
01:29:31 Restoring D:\Projects\CustomerName\Customer Files\xxx-2016-Oct-03.sql
Running: mysql.exe --defaults-file="c:\users\admini~1\appdata\local\temp\2\tmpru2fjn.cnf" --protocol=tcp --host=localhost --user=root --port=3306 --default-character-set=utf8 --comments --database=xxx < "D:\Projects\CustomerName\Customer Files\xxx-2016-Oct-03.sql
ERROR 1305 (42000) at line 33522: FUNCTION xxx.getRates does not exist
Operation failed with exitcode 1
01:34:29 Import of D:\Projects\CustomerName\Customer Files\xxx-2016-Oct-03.sql has finished with 1 errors
When using mysqldump, you must explicitly ask for Stored routines to be dumped. The option is --routines if you are running it manually. If you are running it through some app (Workbench), then look for its mechanism:
[ ] Dump Stored Procedures and Functions
[ ] Dump Events
[ ] Dump Triggers

Running mysqldump throws error 2013

I'm using MySQL Workbench 6.3.6 build 511 CE (64 bits) with MySQL 5.6.25 on Windows 10 that was bundled with XAMPP 5.6.11.
It used to work fine for almost a month in this configuration. I don't recall changing any settings, but suddenly now when I want to export my db it throws this error
mysqldump: Got error: 2013: Lost connection to MySQL server at
'reading authorization packet', system error: 2 when trying to connect
Operation failed with exitcode 2
The error appears even when I try calling mysqldump myself from cmd.
The command that workbench used was this
14:23:26 Dumping invento (all tables)
Running: mysqldump.exe --defaults-file="c:\users\rog\appdata\local\temp\tmp0apjw4.cnf" --host=127.0.0.1 --insert-ignore=TRUE --protocol=tcp --user=root --force=TRUE --port=3306 --default-character-set=utf8 --routines --events "invento"
I should add that the error doesn't always appear
Exit code 2 usually indicates that there is a permissions problem. The most usual suspect is the lack of permissions for the LOCK TABLES command on the given database or table(s) you are trying to dump.
Make sure that the user you use to create the backup with has this permission on the given database table(s). Alternatively you can use the --skip-lock-tables mysqldump option (also see the documentation), so you'll get something like:
mysqldump.exe --defaults-file="c:\users\rog\appdata\local\temp\tmp0apjw4.cnf"
--host=127.0.0.1 --insert-ignore=TRUE --protocol=tcp
--user=root --force=TRUE --port=3306 --default-character-set=utf8
--routines --events "invento"
--skip-lock-tables

How to restore corrupted database file in mysql

I formatted my System (C:)in which my database files are stored unfortunately my database backup have lost.I used recovering tools to recover my database files as dump file.when i tried to restore my dump file its displaying error as i mentioned below,
18:00:34 Restoring E:\pos1.sql
Running: mysql.exe --defaults-file="c:\users\ashfaq\appdata\local\temp\tmpdi5lll.cnf" --host=localhost --user=root --port=3306 --default-character-set=utf8 --comments < "E:\pos1.sql"
ERROR: ASCII '\0' appeared in the statement, but this is not allowed unless option --binary-mode is enabled and mysql is run in non-interactive mode. Set --binary-mode to 1 if ASCII '\0' is expected. Query: ''.
Operation failed with exitcode 1
18:00:36 Import of E:\pos1.sql has finished with 1 errors
any help will be appreciated...

Copying a mysql database generates "ERROR: unknown command" when importing

I'm on a japanese system using xampp. This is the line I use to dump my database.
c:\xampp\mysql\bin>mysqldump.exe -uroot wp_newsja > dump.sql
Then I create a database on another server.
c:\xampp\mysql\bin>mysqladmin -uroot create db
But when I try to execute the sql...
c:\xampp\mysql\bin>mysql -uroot db < dump.sql
... I get the following error.
ERROR at line 145: Unknown command '¥''.
On a japanese computer windows path slashes / are represented with "¥". Which leads me to believe this is an utf8 issue. Maybe there is a way I can mysqldump with some utf8 flag? Thanks for any assistance! The exported sql is here: http://goo.gl/7MPVG - Error at line 145:
edit: Problem solved:
mysql --default-character-set=utf8 db < dump.sql
Sorry if I wasted anyone's time.
mysql --default-character-set=utf8 db < dump.sql
You can add this argument --default-character-set=utf8 in the command:
mysql -u USERNAME -p my_database --default-character-set=utf8 < "C:/My Document Names Have Spaces/my_dump.sql"
I've finally found this solution and it works fine with my new installed WampServer 2.5. I've also tried to add the default character setting in my.ini, but it's useless. Until I've tried the above argument added in my DOS batch file.
My batch file execute the command, like this way:
7zip x -so %1.%2.7z|%mysql% -uxxxx -pyyyyy %2 --default-character-set=utf8
For example, the 7zip filename is 20141231.google.7z, which contains "google.sql", and the database name is google
My backup process on Linux system was a 7zip compressed. In Winodws, I used an automatic batch file to restore the same contents, so that I can share the same database in my biz trip and work offline from the server.
Hope this method is helpful to you.