Перейти к содержанию

convert MyISAM to InnoDB


Рекомендуемые сообщения

hi guys

can someone help me to convert MyISAM to InnoDB? I want a fast and secure way

Ссылка на комментарий
Поделиться на другие сайты

How to grab all the tables which are using MyISAM storage engine?

SELECT CONCAT('ALTER TABLE ', TABLE_SCHEMA, '.', TABLE_NAME,' ENGINE=InnoDB;')
FROM Information_schema.TABLES WHERE TABLE_SCHEMA = 'DBNAME' AND ENGINE = 'MyISAM' AND TABLE_TYPE = 'BASE TABLE'

Where DBNAME is the database name, then copying all the output queries you've to run in console and hit CTRL+Enter

Done! hope that helps :)

Ссылка на комментарий
Поделиться на другие сайты

You have to generate the queries first using the above and then run them in MySQL CLI(Console).

I did it for my forum the same way. I used phpMyAdmin console inside the same database where I had most of the database tables in MyISAM

Ссылка на комментарий
Поделиться на другие сайты

20 hours ago, LoveHate said:

Thanks bro

I'll try it and inform you.

 

Sure thing, good luck :)

Ссылка на комментарий
Поделиться на другие сайты

  • 2 месяца спустя...
7 hours ago, LoveHate said:

Orpheus no bro.

after use that my forum is down

Bruh, I used that SQL query recently and it worked just fine. I can help if you want to

Ссылка на комментарий
Поделиться на другие сайты

Do

ALTER TABLE `table name` ENGINE = INNODB;

for all tables manually. It blocking operations and on large tables can take a long time (forum will stop responding). 

Ссылка на комментарий
Поделиться на другие сайты

Desti Я сделал этот метод, но после окончания работы моя ассоциация развалилась

Ссылка на комментарий
Поделиться на другие сайты

Your DB must be configured for innodb. 

Check 

innodb_buffer_pool_size = (50% of memory)G 
innodb_log_file_size = 256M
innodb_flush_log_at_trx_commit = 1
innodb_flush_method = O_DIRECT

Ссылка на комментарий
Поделиться на другие сайты

2 hours ago, Desti said:

Do

ALTER TABLE `table name` ENGINE = INNODB;

for all tables manually. It blocking operations and on large tables can take a long time (forum will stop responding). 

Doing it manually is a headache, I have a big database and the SQL query I used worked just fine without any errors of sorts. Probably he/she's doing something wrong which has resulted in an error.

@LoveHate What's the size of your database?

Ссылка на комментарий
Поделиться на другие сайты

34 минуты назад, Orpheus сказал:

is a headache

Headache is convert to utf8mb4 :) Manually..

Изменено пользователем Desti
Ссылка на комментарий
Поделиться на другие сайты

9 hours ago, Desti said:

Headache is convert to utf8mb4 :) Manually..

Perhaps!

Ссылка на комментарий
Поделиться на другие сайты

13 hours ago, Orpheus said:

@LoveHate What's the size of your database?

10GB

Ссылка на комментарий
Поделиться на другие сайты

2 hours ago, LoveHate said:

10GB

That's probably not the actual size of the database. Run MySQL optimization to reduce the size.

Below is how you should run the Query if you're using phpMyAdmin

image.png.7be352807b9b7ea703a84629555fb426.png

Ссылка на комментарий
Поделиться на другие сайты

Orpheus bro I'm not familiar with database but I try this way

well in first step I run your query in console section and after that I see the below tables:

Spoiler

a.png.3583d920e429c680f47b4478e0204fb9.png

Then I selected and copied all the output tables and re-entered them in the console section but I got below error:

Spoiler

s.png.beafb8dd5c013f50690d6fa9fdf6416d.png

 

Ссылка на комментарий
Поделиться на другие сайты

OMG..

you haven't completely copied the strings )

 

Every string must edned with ENGINE=InnoDB;

not ENGINE=Inn..

 

Изменено пользователем Desti
Ссылка на комментарий
Поделиться на другие сайты

41 minutes ago, Desti said:

ENGINE=Inn

For me, the output is displayed like this.

What is the problem that does not show the continuation of the string completely?

Ссылка на комментарий
Поделиться на другие сайты

26 минут назад, LoveHate сказал:

the output is displayed like this

You should have saved the query result instead of copying it from the screen.

Ссылка на комментарий
Поделиться на другие сайты

1 hour ago, Desti said:

OMG..

you haven't completely copied the strings

Like I said previously, he might have done something wrong which caused the error.

1 hour ago, LoveHate said:

For me, the output is displayed like this.

What is the problem that does not show the continuation of the string completely?

Follow and fix like this

image.png.7e8f8b7cd156962716d3ed035ea0f891.png

image.thumb.png.21383fff42741a238e7933e14947bc69.png

image.png.450ecf2a6778ebc328c921372aa749ae.png

Then you know what you've to do.

Next step would be; well, In most scenarios you can copy the above result to the notepad and then checking and confirming if all is well and at last run the resulted queries and you'll see a successful operation message.

Ссылка на комментарий
Поделиться на другие сайты

Like this

image.png.00486e3232cec7d87954f5979529599b.png

CTRL + Enter (Windows OS) to execute all the queries you'll generate.

Goodluck :)

Изменено пользователем Orpheus
Ссылка на комментарий
Поделиться на другие сайты

@LoveHate Let us know if you get any error or if you're stuck. We'll help as much as we can :)

Do let us know if you're successful in converting the tables.

Ссылка на комментарий
Поделиться на другие сайты

Orpheus I finally do that :bp::bp::bp::bp::bp::bp::bp:

One question, after copying the output and running it into the console, I got below message. Is this message successful?

In addition, no database type error was observed in the support section of the admin

 

so so thanks again

Ссылка на комментарий
Поделиться на другие сайты

Присоединяйтесь к обсуждению

Вы можете написать сейчас и зарегистрироваться позже. Если у вас есть аккаунт, авторизуйтесь, чтобы опубликовать от имени своего аккаунта.
Примечание: Ваш пост будет проверен модератором, прежде чем станет видимым.

Гость
Ответить в этой теме...

×   Вставлено с форматированием.   Вставить как обычный текст

  Разрешено использовать не более 75 эмодзи.

×   Ваша ссылка была автоматически встроена.   Отображать как обычную ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставлять изображения напрямую. Загружайте или вставляйте изображения по ссылке.

  • Последние посетители   0 пользователей онлайн

    • Ни одного зарегистрированного пользователя не просматривает данную страницу
×
×
  • Создать...