Jump to content
Wiki Home
EPrints Home
Bazaar
Files
Main menu
Main menu
move to sidebar
hide
Navigation
Front Page
EPrints 3 Manual
EPrints Training Course
EPrints Glossary
Installing EPrints
How-to Configure EPrints
EPrints 3.2+ API
EPrints 3 Reference
EPrints Plugins
Wiki
All categories
Recent changes
Main Page
Help
EPrints Documentation
Search
Search
Appearance
Log in
Request account
Personal tools
Log in
Request account
Pages for logged out editors
learn more
Contributions
Talk
Editing
Converting MyISAM tables to InnoDB
Page
Discussion
British English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
Below is Bash script that will convert all tables to InnoDB if they are currently MyISAM. If tables are already InnoDB nothing will change and the script should complete quite quickly. If not you may find it takes several hours to run. It is advised that if you are running this on a live repository you do the following: # Take the repository offline (i.e. either completely stop Apache and the EPrints indexer or get the former to load a splash screen saying the repository is down for maintenance). # Take a backup of the database or if you are running the server as a virtual machine, a snapshot of the whole server. # Run the script below direct from the console or in screen, in case you lose your network connection. <source lang="bash"> #!/bin/bash if [ -z $1 ]; then echo "Usage: $0 <DATABASE_NAME>" exit 1 fi database=$1 read -p "Please enter the hostname of the server hosting this database [localhost]: " hostname read -p "Please enter a username that has permission to alter tables [root]: " username read -sp "Please enter the password for this user: " password if [ -z "$hostname" ]; then hostname="localhost" fi if [ -z "$username" ]; then username="root" fi mysql_password="" if [ ! -z $password ]; then mysql_password="-p$password" fi mysql_start="mysql -h $hostname -u $username $mysql_password $database" for t in $(echo "show tables" | $mysql_start --batch --skip-column-names); do sql="ALTER TABLE \`$t\` ENGINE = InnoDB;" echo $sql time $mysql_start -e "$sql"; done </source>
Summary:
Please note that all contributions to EPrints Documentation may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
EPrints Documentation:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)