We used lnmp to configure a Linux + nginx + mysql + php + apache runtime environment. The mysql version we selected here is: 5542 when performing foreign key operations, we know that the default myisam does not support 1. Preface
We used lnmp to configure a Linux + nginx + mysql + php + apache runtime environment.
The mysql version is 5.5.42.
When performing foreign key operations, we know that the default myisam is not supported. Innodb is required.
2. enable the innodb engine
According to the Internet, the default engine of mysql 5.6 has become innodb, but myisam was used as the default engine.
show engines;
It can be found that there is an innodb field, but the support is no, indicating that you need to configure my. cnf to make it support innodb.
3. process
3.1 Close the mysql service
service mysql stop
3.2 modify the my. cnf file
The path of my. cnf file is in/etc/my. cnf. you only need to modify innodb-related data.
3.3 Restart the mysql service
view sourceprint?1.service mysql start
Encountered a classic problem. View the log file:/usr/local/mysql/var/localhost. localdomain. err
The log file tells us that the/usr/local/mysql/data/ibddata1 file cannot be created due to insufficient permissions.
Ie. mysql only has the r-x permission on the directory data and does not have the w permission. Modify the permission.
3.4 test
As you can see, the default mysql engine is now innodb ~ _~!!