Simple: don't.
It's not relevant at all, and particularly the way you are using it, or planning to use it.
The problem is that MySql is by its very nature a Multiuser system - which gives you problems if you try to use the last ID value, regardless of what you want to use it for.
If you want to use it to access the data you just created, you can't do it reliably like that as the value you get may not be relevant to your user - it could well have been created by a totally different user. The only way to get the ID that you wanted is to SELECT it as part of the INSERT operation using the
LAST_INSERTED_ID[
^] function as part of teh same command, or at the very, very least same connection.
If you want to use it to provide a "next ID" value by adding one to it before you actually do an INSERT, that's even more dangerous, because you have no way of knowing how long it will be before you use it, and that ID can have been used by numerous other users already and your database integrity completely compromised as a result.
You never need an ID value until a row is inserted, and any system which relies on "predicting" ID values is going to fail in production in some really, really nasty ways.
If you are trying to use automatic ID values to provide foreign keys, then I'd strongly suggest you use GUID ID values instead, so you have control over what is going on. The row ID should not be used as a userID or customerID at all...