Hinernate the reverse engineering of MySQL database cannot generate a primary foreign key relationship

Source: Internet
Author: User
Tags php development environment


(1) When we were developing the SSH project, we found that we could not generate the primary foreign key relationship of one-to-one one-to-many and so on using MyEclipse's own Hibernate reverse engineering tool. Obviously the database has been built with the primary foreign key relationship. Why not when the reverse generation?

(2) First of all, I am using the PHP development environment appserv own MySQL database, not installed separately;

(3) This is because of problems with the database engine,

We can enter commands on the SQL command line: show engines;


You can see that default defaults to MyISAM;


(3) "MyISAM database engine does not support transactional processing and does not support foreign keys" We should change to the InnoDB type database engine;

(4) There are two ways to modify the database engine, one is to use the command ALTER TABLE name TYPE=INNODB; To modify, but I did not try to succeed;

The second is to find the My.ini file in the profile summary, a look to understand the comments removed, restart the database is very good


(5) But one of the mistakes in this way is that the server will not start!




Hinernate the reverse engineering of MySQL database cannot generate a primary foreign key relationship

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.