1. Preface
We originally used LNMP to configure a Linux + nginx + mysql + PHP + Apache operating environment.
The MySQL version information we use here is: 5.5.42
In the foreign key operation, we know that the default MyISAM is not supported. Need to use InnoDB.
2. Turn on the InnoDB engine
Online, MySQL 5.6 default engine has become InnoDB, but the previous use of MyISAM as the default engine.
show engines;
It can be found that there is a INNODB field, but support is no, indicating the need to configure MY.CNF to enable him to InnoDB.
3. Process 3.1 Close MySQL service
stop
3.2 Modify MY.CNF File
The my.cnf file path is in/etc/my.cnf, as long as the data related to InnoDB is modified.
3.3 Restart MySQL Service
start
Encounter a classic problem. Then go to view the log file:/usr/local/mysql/var/localhost.localdomain.err
The log file tells us that the permissions are insufficient to create the/usr/local/mysql/data/ibddata1 file.
ie, user MySQL to directory data only R-x permissions, no W permissions. Then modify the permissions just fine.
3.4 Testing
As you can see, the default engine of MySQL now becomes InnoDB ~_~!!
Centos 7 MySQL 5.5 enable InnoDB engine