I'm trying to create a UUID within PHPMyAdmin on my web host/server, I've created a table called 'video' and I've inserted a field in there called 'uuid', but I don't know how to actually turn the field into a UUID, I have a feeling I'm missing something really basic here, so any help would be appreciated. Thanks in advance.
Asked
Active
Viewed 9,773 times
2 Answers
3
You need to create a column of an appropriate data type to store it, then when inserting data use the UUID() function. There are several means to store the resulting data, including in a CHAR type, but since it's a number you may wish to store it as a number. This is a pretty good explanation. Also, this thread has additional information that may help.
When inserting from phpMyAdmin, look for the Function dropdown, which has "UUID()" near the bottom.

Isaac Bennetch
- 11,830
- 2
- 32
- 43
-
Cheers Isaac I'll give it a go and get back to you thank you very much for your reply – logikurl Mar 31 '14 at 17:45
-
I've changed it to INT to represent it as a number and given it a count 36 as that's how much UUID's are correct? Strangely, I don't have a UUID option in the whole of my drop down, here is a picture of what I am seeing http://imgur.com/4BQomeY – logikurl Mar 31 '14 at 18:48
-
Keep scrolling the function list down, it should be near the very bottom. – Isaac Bennetch Mar 31 '14 at 19:14
-
This is odd, I've double checked and there definitely isn't a UUID option, is it specific to a certain field type? I tried changing the field type to CHAR, VARCHAR etc. also but it gave me the same options as the ones in the screenshot, that screenshot I showed you was at the bottom of the list. I'm using PHPMyAdmin Version 2.11.4 if that helps? – logikurl Apr 02 '14 at 19:43
-
I've done a quick test by downloading the 2.11.12 release and also don't see the UUID function. I'd suggest updating your phpMyAdmin version, that should resolve the problem. – Isaac Bennetch Apr 03 '14 at 13:05
-
http://docs.phpmyadmin.net/en/latest/setup.html#upgrading-from-an-older-version may help with that. – Isaac Bennetch Apr 03 '14 at 13:09
-
Cheers Isaac I am currently using a free hosting server, so there may be limitations to upgrading PHPMyAdmin, will this update method work for that? – logikurl Apr 04 '14 at 17:01
-
If your host provides the phpMyAdmin, you could bug them to update it :-) But yes, you can install your own phpMyAdmin independent of theirs, although you should give the folder a different name than what they use to avoid conflict. Follow the instructions for a new installation instead of an upgrade in this case. – Isaac Bennetch Apr 05 '14 at 13:19
0
Just in case, if like me, you were looking for how to create the UUID field on phpmyadmin, especially the type you have to choose, here is a screenshot after it was automatically done by laravel (It is the "id" named field of course in this example): UUID field type in phpmyadmin

AnaiO
- 137
- 1
- 7