LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-20-2010, 01:41 AM   #1
Stephan_Craft
Member
 
Registered: Jul 2008
Posts: 184

Rep: Reputation: 30
How to change DATABASE ENGINE to innodb?


Hi,
How to change DATABASE ENGINE to innodb? by default it's Myisam
I tried
ALTER DATABASE database_name ENGINE ='innodb';
ERROR 1064 (42000): You have an error in your SQL syntax;
 
Old 02-20-2010, 08:27 AM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
The storage engine is specified per table. If you want to change it, you'd have to alter the table:
Code:
ALTER TABLE t ENGINE = INNODB;
You can also set the default storage type to INNODB, of you can create a table using INNODB.
http://dev.mysql.com/doc/refman/5.0/...e-engines.html

jlinkels
 
Old 02-20-2010, 11:29 PM   #3
Stephan_Craft
Member
 
Registered: Jul 2008
Posts: 184

Original Poster
Rep: Reputation: 30
That's I know. my question was how to change DATABASE engine
 
Old 02-21-2010, 07:18 AM   #4
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
If it is specified per table, how can you change it per database? You can set a default value for the database so all new tables will be created using that default value.

jlinkels
 
Old 02-21-2010, 09:48 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Set the default storage engine:

http://dev.mysql.com/doc/refman/5.0/...r-options.html
Quote:
--default-storage-engine=type
Command-Line Format --default-storage-engine=name
Config-File Format default-storage-engine

Set the default storage engine (table type) for tables. See Chapter 13, Storage Engines.
http://dev.mysql.com/doc/refman/5.0/...e-engines.html
Quote:
If you omit the ENGINE or TYPE option, the default storage engine is used. Normally, this is MyISAM, but you can change it by using the --default-storage-engine or --default-table-type server startup option, or by setting the default-storage-engine or default-table-type option in the my.cnf configuration file.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL fails to start after loading dumped InnoDB database timhilliard Linux - Newbie 3 03-25-2009 07:41 AM
Database engine fot book digitalization zWaR Programming 2 11-12-2007 04:18 PM
Database Structure of Search Engine pijush General 1 05-21-2007 06:17 AM
Dual Booting Database engine Paulsuk Linux - Software 1 04-11-2006 08:28 PM
innodb engine varun_33 Linux - General 0 05-16-2005 05:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration