MYBB work with Azure MYSQL

  • fennng 
As Azure MYSQL doesn’t support MyISAM, MYBB is not working with Azure MYSQL directly. You will get following error during db creation.


More info:
 
To solve this problem, we can  connect mybb to a local mysql server to create a working db first, then convert all tables to use innodb engine. Then export and import to azure mysql.
 
Here are the steps:
 
Create a docker mysql server
 
docker run –name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root mysql
Create a docker phpmyadmin and use it to create a mybb db
docker run –name myadmin2 –rm –link mysql:db -p 8083:80 phpmyadmin/phpmyadmin
Connect mybb to mysql (use docker container ip address instead of localhost) to create database
 
User PhpMyAdmin to convert the engine
 
1. Find all the table using MyISAM, Check “Show all” to list all the tables (49 in total)
 
use this scripts: (change dbname to match your db name)
 
SELECT TABLE_NAME FROM information_schema.TABLES
    WHERE TABLE_SCHEMA = 'dbname' AND engine = 'MyISAM';
 

User column editor to generate the sql script

 

Paste script into phpMyAdmin

Run the script

​export mybb db

Run another docker phpmyadmin to connect to azure mysql
docker run –name myadmin2 –rm -e PMA_HOST=azure_db_host -p 8084:80 phpmyadmin/phpmyadmin
Create an empty mybb db

​Import mybb db to azure mysql

Start a new mybb docker and connect to azure sql server
docker run –name mybb2 -p 8085:80 fbmac/mybb
​Then go through the installation steps. You will still fail on table Creation

​But you don’t need to worry about it, because you have already have the inc/config.php setup with correct db info.
You can also edit this file directly without going though the install steps.
Now lock the install folder
​docker exec -it mybb2 bash
cd mybb
cd install/
 cd . > lock
 
You are good to go, if you have installed language pack before, you need to add language pack to your new mybb instance.
 
go to the folder containing language pack and run
 
docker cp inc mybb2:/var/www/mybb
 
You can also update config.php file from your old mybb instance, that may make thing easier.

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注