Here are seven ways to check what version of MySQL you’re running.
Continue readingAuthor: Ian
Fix Msg 3728 in SQL Server “… is not a constraint”
If you’re getting an error that reads something like “Msg 3728, Level 16, State 1, Line 1
‘DF__Dogs__DogId__6FE99F9F’ is not a constraint“, it’s probably because you’re trying to drop a constraint that isn’t in the database.
To fix this issue, check to make sure the constraint exists before dropping it. Alternatively, use the IF EXISTS
clause to drop the constraint only if it exists.
MySQL VERSION() Explained
In MySQL, VERSION()
is a built-in function that returns the MySQL server version.
The result is a string that uses the utf8mb3
character set. A suffix may also be appended to the version number indicating server build or configuration information.
Fix “ERR wrong number of arguments for ‘hrandfield’ command” in Redis
If you’re getting an error that reads “ERR wrong number of arguments for ‘hrandfield’ command“, it’s probably because you’re not passing any arguments when using the HRANDFIELD
command.
The HRANDFIELD
command requires at least one argument, and accepts up to three arguments (at the time of writing).
MySQL Date Format Specifiers (Full List)
The following table contains a full list of format specifiers that can be used in format strings with functions like DATE_FORMAT()
, STR_TO_DATE()
, and FROM_UNIXTIME()
in MySQL.
How to Create a Repeating Sequence in SQL Server
When we create a sequence object in SQL Server, we have the option of making it a repeating sequence or a nonrepeating sequence. By repeating I mean, we can have the sequence continually start again once the min/max value has been reached. In other words, we can have the sequence reiterate over and over again.
We can do this with the CYCLE
argument.
Fix “WRONGTYPE Operation against a key holding the wrong kind of value” when Setting a Hash in Redis
If you get an error that reads “WRONGTYPE Operation against a key holding the wrong kind of value” when setting a hash with a command like HSET
or HSETNX
, it’s probably because you’re trying to set a non-hash key that already exists. In other words, the key already exists, but it doesn’t contain a hash.
To fix this issue, be sure to use these commands on keys that either don’t already exist, or contain a hash.
Continue readingMySQL SESSION_USER() Explained
In MySQL, SESSION_USER()
is a synonym for the USER()
function. It returns the current MySQL user name and host name, given when connecting to MySQL.
MySQL SYSTEM_USER() Explained
In MySQL, SYSTEM_USER()
is a synonym for the USER()
function. It returns the current MySQL user name and host name, given when connecting to MySQL.
How to Set Up Named Time Zones in MySQL
If you want to use named time zones in MySQL, you’ll need to make sure they’ve been configured.
By “named time zones”, I mean being able to use strings like US/Eastern
instead of −04:00
or −05:00
when specifying the time zone. For example, when using the CONVERT_TZ()
function.
Here’s how to configure named time zones in MySQL.
Continue reading