Title: RANDOM_BYTES does not exist
Last modified: August 12, 2022

---

# RANDOM_BYTES does not exist

 *  Resolved [doowdle](https://wordpress.org/support/users/doowdle/)
 * (@doowdle)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/)
 * MariaDB does not have this method RANDOM_BYTES. Can you update the plugin to 
   support MariaDB? It is the default database for many hosts and the only one in
   for example cloudways.

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/random_bytes-does-not-exist/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/random_bytes-does-not-exist/page/2/?output_format=md)

 *  [David Mitchell](https://wordpress.org/support/users/david-mitchell/)
 * (@david-mitchell)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/#post-15911886)
 * Seconded. Just ran into this on Kinsta.
 *  [codeink](https://wordpress.org/support/users/codeink/)
 * (@codeink)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/#post-15912016)
 * I’ve also run into this. Am on Cloudways.
 *  [srw](https://wordpress.org/support/users/srw/)
 * (@srw)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/#post-15912022)
 * Yes. Was just looking for answers on this error. Hoping there’s a quick update
   to fix it.
 *  [bgswebmaster](https://wordpress.org/support/users/bgswebmaster/)
 * (@bgswebmaster)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/#post-15912235)
 * I am having this same issue on namehero server with Event Manager plugin.
 *     ```
       Events Manager is trying to update your database, but the following error occured:
   
       FUNCTION broomfie_wp92.RANDOM_BYTES does not exist
   
       It might be that reloading this page one or more times may complete the process, if you have a large number of bookings in your database. Alternatively, you can run one of these two queries directly into your WP database:
   
       UPDATE wph1_em_bookings SET booking_uuid= LOWER(CONCAT( HEX(RANDOM_BYTES(4)), '', HEX(RANDOM_BYTES(2)), '4', SUBSTR(HEX(RANDOM_BYTES(2)), 2, 3), '', HEX(FLOOR(ASCII(RANDOM_BYTES(1)) / 64) + 8), SUBSTR(HEX(RANDOM_BYTES(2)), 2, 3), '', hex(RANDOM_BYTES(6)) ))
   
       OR
       UPDATE wph1_em_tickets_bookings SET ticket_uuid= UUID()
       ```
   
 * And the 1st SQL update fails since the function does not exist and the 2nd SQL
   update gives 0 records updated.
 * Please help!
 *  [cdgweb](https://wordpress.org/support/users/cdgweb/)
 * (@cdgweb)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/#post-15912352)
 * Also having this problem. Tried running both scripts in mySQL – no bueno.
 * I am *not* using bookings.
    -  This reply was modified 3 years, 9 months ago by [cdgweb](https://wordpress.org/support/users/cdgweb/).
 *  [jeroenhuijben](https://wordpress.org/support/users/jeroenhuijben/)
 * (@jeroenhuijben)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/#post-15912455)
 * Same here.
 * Server version: 10.3.20-MariaDB-1:10.3.20+maria~bionic – mariadb.org binary distribution
 *  [EMar](https://wordpress.org/support/users/sounds/)
 * (@sounds)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/#post-15912776)
 * Same error message here.
    Tried adding the two queries in phpmyadmin/mysql, but
   no luck.
 *  [Guido](https://wordpress.org/support/users/guidodr/)
 * (@guidodr)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/#post-15912823)
 * I do have the same error.
 * The function RANDOM_BYTES will only be introduced in MariaDB version 10.10.0 
   which is currently in alpha status. The latest version is currently 10.8.3
    [https://mariadb.com/kb/en/random_bytes/](https://mariadb.com/kb/en/random_bytes/)
 * Therefore RANDOM_BYTES should not yet be used in the plugin if a MariaDB is used
   which is quite often used together with WordPress.
 * For a MariaDB there should be used instead of for example `RANDOM_BYTES(4)` then`
   SUBSTR(MD5(RAND()), 1, 4)`
 * But running the changed sql statement `UPDATE wp_20170105_114905_em_bookings 
   SET booking_uuid= LOWER(CONCAT( HEX(SUBSTR(MD5(RAND()), 1, 4)), '', HEX(SUBSTR(
   MD5(RAND()), 1, 2)), '4', SUBSTR(HEX(SUBSTR(MD5(RAND()), 1, 2)), 2, 3), '', HEX(
   FLOOR(ASCII(SUBSTR(MD5(RAND()), 1, 1)) / 64) + 8), SUBSTR(HEX(SUBSTR(MD5(RAND()),
   1, 2)), 2, 3), '', hex(SUBSTR(MD5(RAND()), 1, 6)) ))` directly on the MariaDB
   database will not help since the plugin will still always try to update with 
   the RANDOM_BYTES function and will always create the error.
 * Therefore the plugin itself needs to be corrected.
    -  This reply was modified 3 years, 9 months ago by [Guido](https://wordpress.org/support/users/guidodr/).
 *  [EMar](https://wordpress.org/support/users/sounds/)
 * (@sounds)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/#post-15912883)
 * Yes, the first query threw an error in the database, about RANDOM_BYTES does 
   not exist. I’ll leave it alone for now until there’s a proper fix.
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/#post-15913511)
 * For anyone with this issue, we’ve updated a dev version 6.1.0.1 which fixes this
   specific issue (tested and confirmed). We’ll release a regular update within 
   the next day or sooner.
 * To upgrade to a dev version, visit _Dashboard > Events > Settings > Admin Tools_
   and click the _Check Dev Updates_ button. You’ll see the update appear on your
   plugins/updates page. You can also manually update by downloading the dev versions
   [from our downloads page](https://eventsmanagerpro.com/downloads/). For more 
   detailed instructions, see our [documentation for upgrading to dev versions](http://wp-events-plugin.com/documentation/upgrade-dev-version/).
 * The issue was mainly related to the adding of UUID for old bookings and ticket
   bookings, in theory this shouldn’t have affected your installation as the main
   use of UUIDs are currently for the recent Pro features like QR tickets and checkins.
 * It looks like the error is limited to those using MariaDB (correctly identified
   by [@guidodr](https://wordpress.org/support/users/guidodr/)) instead of mySQL,
   that RANDOM_BYTES function in the SQL statement is available in MariaDB 10.10
   and I believe we misread the min WP version with 10.1 (the trailing 0 made all
   the difference!). Whilst we usually keep relatively straightforward SQL statements,
   we’ll be more mindful of our MariaDB users moving forward, should we ever need
   to add with more complex queries.
 *  [richieboo](https://wordpress.org/support/users/richieboo/)
 * (@richieboo)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/#post-15913730)
 * 6.1.0.1 update did not fix for us, running 10.3.35-MariaDB – MariaDB Server ..
   will keep looking for another update and hope it fixes. Glad this is a known 
   issue.
 * Server: Localhost via UNIX socket
    Server type: MariaDB Server version: 10.3.35-
   MariaDB – MariaDB Server Protocol version: 10 Server charset: cp1252 West European(
   latin1) cpsrvd 11.104.0.7 Database client version: libmysql – mysqlnd 7.4.30 
   PHP extension: mysqliDocumentation curlDocumentation mbstringDocumentation PHP
   version: 7.4.30
 *  [Guido](https://wordpress.org/support/users/guidodr/)
 * (@guidodr)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/#post-15913859)
 * [@richieboo](https://wordpress.org/support/users/richieboo/) are you sure that
   6.1.0.1 did not fix it for you?
    The old error message you will have to delete
   first. That old error message will not disappear automatically. At least on my
   side with MariaDB 10.8.3 it did fix it. The message did not reappear after the
   installation for 6.1.0.1
 *  [skoenemann](https://wordpress.org/support/users/skoenemann/)
 * (@skoenemann)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/#post-15913892)
 * My host currently uses MariaDB 10.5 and the 6.1.0.1 EM Dev update fixed the problem.
 *  [richieboo](https://wordpress.org/support/users/richieboo/)
 * (@richieboo)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/#post-15913975)
 * RE: The old error message you will have to delete first. That old error message
   will not disappear automatically.
 * That was it, I was expecting it to go away. 🙂
    It has not re-appeared, thanks!
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/#post-15914829)
 * Thanks for pointing that out [@richieboo](https://wordpress.org/support/users/richieboo/)
   that can be confusing 🙂
 * That error message should have gone away, but the id used to identify that error
   message changed with the dev update. We’ll update that before we release, but
   you can just click the X on the right and it’ll disappear and not reappear, same
   result.
 * We’ll update in a few hours.

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/random_bytes-does-not-exist/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/random_bytes-does-not-exist/page/2/?output_format=md)

The topic ‘RANDOM_BYTES does not exist’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=1039078)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

## Tags

 * [Database Error](https://wordpress.org/support/topic-tag/database-error/)

 * 19 replies
 * 12 participants
 * Last reply from: [doowdle](https://wordpress.org/support/users/doowdle/)
 * Last activity: [3 years, 9 months ago](https://wordpress.org/support/topic/random_bytes-does-not-exist/page/2/#post-15916553)
 * Status: resolved