Tell me more ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I modified th my.cnf file, so that the innodb_data_file_path points somewhere else from the default path. But the mysqldump command seems like trying to dump from the default path.

I found that if i give the option --defaults-file=xxxx in command line i could change it, but is there a way to config mysqldump to use this option without specify it in command line?

share|improve this question

migrated from stackoverflow.com Jan 23 at 18:06

1 Answer

Unfortunately, there is no mechanism for innodb_data_file_path in terms of a mysqldump.

You could set mysqldump options in /etc/my.cnf. Simply go to the bottom and add the following

[mysqldump]
routines
triggers
force

Then, whenever you launch mysqldump, these options are read.

Contrariwise, innodb_data_file_path is a storage-engine specific option for mysqld. You cannot place innodb_data_file_path under a [mysqldump] group header. When calling mysqldump, whatever the MySQL Instance has set, that's what mysqldump uses.

Please put back the original innodb_data_file_path or MySQL will fail to start upon the next restart of mysqld.

You need to check out if InnoDB is functional. Please run SHOW ENGINES;. You should see:

mysql> SHOW ENGINES;
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine             | Support | Comment                                                        | Transactions | XA   | Savepoints |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| FEDERATED          | YES     | Federated MySQL storage engine                                 | NO           | NO   | NO         |
| MRG_MYISAM         | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |
| MyISAM             | YES     | MyISAM storage engine                                          | NO           | NO   | NO         |
| BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |
| CSV                | YES     | CSV storage engine                                             | NO           | NO   | NO         |
| MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |
| ARCHIVE            | YES     | Archive storage engine                                         | NO           | NO   | NO         |
| InnoDB             | DEFAULT | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |
| PERFORMANCE_SCHEMA | YES     | Performance Schema                                             | NO           | NO   | NO         |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
9 rows in set (0.03 sec)

mysql> 

If InnoDB does not appear, check the my.cnf for typos. In fact, you have comment that says

innodb_data_file_path =Qibdata1:10M:autoextend

This could cause a disconnect between ibdata1 (which houses the data dictionary and other things) and the datadir for each database that has one or more .frm files for InnoDB tables.

share|improve this answer
mysqld restarts with no problem. i had to do it because the file was corrupted. So i change the file and i restore the databases from the backup. I guess that mysqldump uses the old file cause it show an error that file is corrupted. I cannot tell you the error exactly, right now, but will asap. – pbaris Jan 23 at 21:13
Three Questions : 1) When you run SHOW ENGINES;, does InnoDB come up as Default ? 2) Can you access any InnoDB table ? 3) What is the location of the file ibdata1 ? – RolandoMySQLDBA Jan 23 at 21:22
i see a problem right now. i don't see innodb in my engines. I do not know why. I saw it in the morning, but not right now. my config is innodb_data_home_dir = /var/lib/mysql innodb_data_file_path =Qibdata1:10M:autoextend innodb_log_group_home_dir = /var/lib/mysql innodb_buffer_pool_size = 400M innodb_additional_mem_pool_size = 40M innodb_log_file_size = 100M innodb_log_buffer_size = 4M innodb_flush_log_at_trx_commit = 1 innodb_lock_wait_timeout = 50 innodb_flush_method=O_DIRECT – pbaris Jan 23 at 21:40
Look back in your last comment. Do you realize you have innodb_data_file_path =Qibdata1:10M:autoextend. I see a capital Q after the =. Or is that just a momentary typo in the comment ??? – RolandoMySQLDBA Jan 23 at 21:53
no unfortunately is not a typo. The strange thing is that the files is created in /var/lib/mysql and all works just fine. All projects that uses the databases works as they should. – pbaris Jan 23 at 22:03
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.