MySQL UUID primary key - generated by PHP or by MySQL?
问题 I was under the impression that just having MySQL generate the primary key via UUID() would make the key unique across servers, etc. But, there is no way to fetch the last inserted UUID, which requires that an extra select statement be done each time I insert. Is it possible to have PHP generate the exact same UUID() that MySQL would generate? 回答1: No, it's not possible to have PHP generate the exact same UUID() as MySQL because it's a (completely) random number. It sounds like your problem