My current version of mysql is 5.0.77. I created a database and is trying to load my data into the MyISAM tables with the "load data infile" command. The data are ~3.5GB in size.
I encounter this error while loading:-
Error (Code 3): Error writing file '/tmp/STH06V6g' (Errcode: 28)
Error (Code 1034): 28 when fixing table
Error (Code 1034): Number of rows changed from 106558636 to 237525263
When i check /var/logs/mysqld.log, it displays this warning:-
120420 9:33:10 [Warning] Warning: Enabling keys got errno 28 on sample.X004,retrying
I did a df -h to check on my file usage:-
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/KusuVolGroup00-VAR
2.0G 1.6G 342M 82% /var
I did not enable/disable any keys prior to loading. May I know how do I go about this error?
Thank you so much in advance!
Joanne
Error code 28 means "no space left on device".
Related
I’m in the progress of migration a large mysql database to a “Azure-database voor MySQL Flexible Server”.
The database has a few tables that are larger than 1GB, the largest one being 200GB. All tables are InnoDB tables.
Because of the size of the tables, a normal mysql dump didn’t work, so as suggested here, I resorted to MyDumper/MyLoader: https://learn.microsoft.com/en-us/azure/mysql/concepts-migrate-mydumper-myloader
I dumped one of the large tables (a 31GB table) with the following command:
mydumper --database mySchema \
--tables-list my_large_table
--host database
--user root
--ask-password
--compress-protocol
--chunk-filesize 500
--verbose 3
--compress
--statement-size 104857600
I then copied the files over to a VM in the same region/zone as the Azure database and started the import with the following command:
myloader --directory mydumpdir \
--host dbname.mysql.database.azure.com \
--user my_admin \
--queries-per-transaction 100 \
--ask-password \
--verbose 3 \
--enable-binlog \
--threads 4 \
--overwrite-tables \
--compress-protocol
MyLoader seems to start loading and produced the following output:
** Message: 08:37:56.624: Server version reported as: 5.7.32-log
** Message: 08:37:56.674: Thread 1 restoring create database on `mySchema` from mySchema-schema-create.sql.gz
** Message: 08:37:56.711: Thread 2 restoring table `mySchema`.`my_large_table` from export-20220217-073020/mySchema.my_large_table-schema.sql.gz
** Message: 08:37:56.711: Dropping table or view (if exists) `mySchema`.`my_large_table`
** Message: 08:37:56.979: Creating table `mySchema`.`my_large_table` from export-20220217-073020/mySchema.my_large_table-schema.sql.gz
** Message: 08:37:57.348: Thread 2 restoring `mySchema`.`my_large_table` part 3 of 0 from mySchema.my_large_table.00003.sql.gz. Progress 1 of 26 .
** Message: 08:37:57.349: Thread 1 restoring `mySchema`.`my_large_table` part 0 of 0 from mySchema.my_large_table.00000.sql.gz. Progress 2 of 26 .
** Message: 08:37:57.349: Thread 4 restoring `mySchema`.`my_large_table` part 1 of 0 from mySchema.my_large_table.00001.sql.gz. Progress 3 of 26 .
** Message: 08:37:57.349: Thread 3 restoring `mySchema`.`my_large_table` part 2 of 0 from mySchema.my_large_table.00002.sql.gz. Progress 4 of 26 .
When I execute a "show full processlist" command on the Azure database, I see the 4 connected threads, but I see they are all sleeping, it seems like nothing is happening.
When I don't kill the command, it errors out after a long time:
** (myloader:31323): CRITICAL **: 17:07:27.642: Error occours between lines: 6 and 1888321 on file mySchema.my_large_table.00002.sql.gz: Lost connection to MySQL server during query
** (myloader:31323): CRITICAL **: 17:07:27.642: Error occours between lines: 6 and 1888161 on file mySchema.my_large_table.00001.sql.gz: MySQL server has gone away
** (myloader:31323): CRITICAL **: 17:07:27.642: Error occours between lines: 6 and 1888353 on file mySchema.my_large_table.00003.sql.gz: Lost connection to MySQL server during query
** (myloader:31323): CRITICAL **: 17:07:27.642: Error occours between lines: 6 and 1888284 on file mySchema.my_large_table.00000.sql.gz: MySQL server has gone away
After these errors, the table is still empty.
I tried a few different settings when dumping/loading, but to no avail:
start only 1 thread
make smaller chunks (100mb)
remove --compress-protocol
I also tried importing a smaller table (400MB in chunks of 100MB ), with exactly the same settings, and that did actually work.
I tried to import the tables into a mysql database on my local machine, and there I experienced exactly the same problem: the large table (31GB) import created 4 sleeping threads and didn't do anything, while the smaller table import (400MB in chunks of 100MB) did work.
So the problem doesn't seem to be related to the Azure database.
I now have no clue what the problem is, any ideas?
I had a similar problem, for me it ended up being the instance I was restoring into was too small, the server kept running out of memory. Try temporarily increasing the instance size to a much larger size, and once the data is imported shrink the size of the instance back down.
We have taken the export backup of DBA_REP (database-1) and importing to cust1_rep (database-2) i.e customer repository, while importing into cust1_rep, we are getting below error.
When we are checking line no 126, its showing ENGINE=MyISAM */. Instead of INNODB.
[root#MTC-ZURICH-TOMCAT1 MySql_dumps]# cat imp_dba_rep.log
ERROR 1030 (HY000) at line 126: Got error 1 from storage engine
I want to load file into a table. I am using this command.
LOAD DATA LOCAL INFILE 'home/myuser/Documents/my_project/project_sub_directory/project_sub_directory2/project_sub_directory3/my_data_file.txt'
INTO TABLE `mydatabse`.`my_table`
fields terminated BY ',';
I use LOCAL in the command to avoid the following error (an avoid moving my data files to another directory):
Error Code: 1290. The MySQL server is running with the
--secure-file-priv option so it cannot execute this statement
After executing the command, I get this error:
Error Code: 2. File
'home/myuser/Documents/my_project/project_sub_directory/project_sub_directory2/project_sub_directory3/my_data_file.txt'
not found (Errcode: 2 - No such file or directory)
How to resolve the issue without moving my data file to another directory?
I have cloned the LIB_MYSQLUDF_JSON filed from github and copied the lib_mysqludf_json.so file into the /usr/local/mysql/lib/plugin directory as indicated in the instructions. When I run the command mysql> CREATE FUNCTION json_values RETURNS STRING SONAME 'lib_mysqludf_json.so'; I get the following error:
ERROR 1126 (HY000): Can't open shared library 'lib_mysqludf_json.so' (errno: 0 dlopen(/usr/local/mysql/lib/plugin/lib_mysqludf_json.so, 2): no suitable image found. Did find: /usr/local/mysql/lib/plugin/li)
I got no better results when I ran the gcc -shared -o command with respect to the lib_mysqludf_json.so and lib_mysqludf_json.c files before copying the lib_mysqludf_json.so file to the mysql plugin directory.
I have searched for results for the above error, which resulted in many hits, but nothing has yet indicated what might be the issue for me.
I am trying to run all this on a MacBook Pro with OS X Lion. Any insight would be appreciated.
Am getting following "permissions" error when trying to import an sqldump
Error Code: 1 - Can't create/write to file
'C:\ProgramData\MySQL\MySQL Server 5.5\Data\dealcrm\accessorieslink.MYI'
(Errcode: 13)
I have renamed the data folder and put it back recently.
Have tried giving full control for user "system" on the data folder - this is user
the mysql service is started with
any help welcome
EDIT**
Have also tried adding a folder C:/ProgramData/MySQL/MySQL Server 5.5/Temp/
and added this line to mysql.ini
tmpdir="C:/ProgramData/MySQL/MySQL Server 5.5/Temp/"
after import there are some files in the folder but still get error 13
As per documentation of the error code, in your particular situation, i.e. on Windows, you're most likely lacking a setting of the right temp directory where MySQL can dump tempfiles. Set it as described in the link above and you should be fine.