MySQL: does MyISAM have tablespaces? - mysql

Can i create tablespaces with a MyISAM table running on MySQL 5.1.30?

Tablesspaces (in MySQL 5.1) are only supported for NDB and NDBCLUSTER, cf http://dev.mysql.com/doc/refman/5.1/en/create-tablespace.html:
The ENGINE parameter determines the storage engine which uses this
tablespace, with engine_name being the name of the storage engine. In
MySQL 5.1, engine_name must be one of the values NDB or NDBCLUSTER.
But you can tell MySQL which data- and index-dir to use for MyISAM, cf. http://dev.mysql.com/doc/refman/5.1/en/create-table.html:
By using DATA DIRECTORY='directory' or INDEX DIRECTORY='directory' you
can specify where the MyISAM storage engine should put a table's data
file and index file. The directory must be the full path name to the
directory, not a relative path.

Related

MySQL 5.1 InnoDB file-per-table option

My application uses MySQL 5.1.49 as its main DB.
The default table engine for my version of MySQL is MyISAM, but since I want to use InnoDB (which is the default engine for version 5.5 and higher), I have to specify the following line in the end of each CREATE TABLE statement:
ENGINE = InnoDB DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_bin';
I need to save a specific table in a different location within the file system. I turned on the file-per-table option, and added the DATA DIRECTORY flag.
MySQL ignores the DATA DIRECTORY flag when the active engine is InnoDB.
If I remove the InnoDB statement (thus forcing it to work with the default engine, MyISAM), it works, but then I lose all the advantages of the InnoDB engine.
Is there a way to combine them both WITHOUT upgrading to MySQL 5.5?
Thanks
No, the DATA DIRECTORY option is not supported for InnoDB until MySQL 5.6. The only way to achieve what you want would be to use symlinks at the filesystem level, but this is very dangerous and not recommended.

MySQL database engine: MyISAM for information_schema but InnoDB for other databases

I am currently using InnoDB for all my databases in MySQL, however I just noticed that my information_schema database uses MyISAM for tables that are not MEMORY.
I am in the process of investigating an InnoDB/MyISAM issue. While I don't think this is the cause of it, I am worried about this mixing. The database was originally set up with MyISAM. Later the my.cnf file was updated to reset the engine to InnoDB. I am using MySQL 5.5.10.
What are the possible issues that could occur with having your information_schema database set to MyISAM, but all your other databases set to MySQL?
For those looking for help:
If you came across this question in search of an answer or you want to know more, to see your default database engine:
show variables;
To see the engine assigned to tables in a database:
show table status;
My my.cnf settings:
[client]
default-character-set=utf8
[mysqld]
log=/usr/local/var/mysql/mysqld.log
character-set-server = utf8
collation-server = utf8_general_ci
lower_case_table_names=2
default_storage_engine=InnoDB
# Performance hacks:
innodb_flush_method=nosync
innodb_flush_log_at_trx_commit=0
The storage engine used is on a per-table basis. The default storage engine is used when creating a new table and you don't specify a storage engine for the new table.
The system tables would have been MyISAM regardless of what you set the default storage engine to.
From MySQL documentation:
Important
Do not convert MySQL system tables in the mysql database (such as user
or host) to the InnoDB type. This is an unsupported operation. The
system tables must always be of the MyISAM type.
If you are not querying the information_schema tables directly, there is no concern about mixing the types.

Mysql InnoDB database

All of my tables are InnoDB but PHPMyAdmin shows that the database is MyIsam: http://img708.imageshack.us/i/201103080940551280x800s.png/
How do I create new MySQL databases using InnoDB?
Running MySQL 5.1, in a Debian Sid box.
Thank you.
AFAIK it is showing MyISAM because that is your default storage engine on that database, i.e. if you were to create a new table and not specify the engine then it would be MyISAM.
You can change the default storage engine in your my.cnf file:
default-storage-engine=INNODB
Use MySQL Workbench for GUI interface:
http://wb.mysql.com/
You can it directly using SQL also:
ALTER TABLE products ENGINE = innodb

InnoDB restore database is very slow

I have Mysql installed version 5.1.49-1ubuntu8.1 (with default InnoDB without any modification)
When using InnoDB, the mysqldump and read performance is comparable to MyISAM, but restore database is very slow.
When trying to install Drupal on blank database also take too long
Other than default-storage-engine = innodb, Is there anything I need to do before use InnoDB?
You should disable keys on the tables while restoring. This is the default behavior with the dumps generated from mysqldump. What is the command line you are using for dumping data?
You should dump the tables in the order of the primary key.

Convert InnoDB to MyISAM with InnoDB disabled

I'm the lucker owner of a webhotel where the host changes settings without telling.
When thats said,
I have some tables in my database that are running with InnoDB engine.
But over the night the host have disabled InnoDB, so I cant convert it to MyISAM with ALTER command.
Anyway I can get the data out of the database, or convert it to MyISAM when InnoDB is disabled?
Only thing I see all the time is,
#1033 - Incorrect information in file: 'file.frm'
Thanks.
Unfortunately, you need to have InnoDB enabled so that MySQL could read the data for conversion.
To recover the data on another instance, you would need ibdata* files from MySQL root data directory as well as all *.ibd files from your database directory (if your MySQL setup had innodb_file_per_table enabled).