Adding a file in innodb

From Wikitech
Jump to navigation Jump to search

edit /etc/my.cnf

at line innodb_data_file_path = /usr/local/mysql/data/ibdata1:20000M:autoextend

add the second file like this :

innodb_data_file_path = /mnt/raid1/ibdata2:60000M;/usr/local/mysql/data/ibdata1:20000M:autoextend

Nota : the autoextend file must be the last on the line

  • stop mysql : mysqladmin -u root -p shutdown
  • start mysql : mysqld_safe

It could take some time, time to rebuild the innodb space. You can follow the process in .err file

And... it doesnt work

autoextend must be the last file, but a new file must be add in last....

Plan B :

  • stop mysql
  • note the size of ibdata1, the autoextend file
  • convert in MB (size /1024 /1024)
  • put innodb_data_file_path = /usr/local/mysql/data/ibdata1:87544M;/mnt/raid1/ibdata2:60000M;/usr/local/mysql/data/ibdata3:50M:autoextend
  • restart mysql