As described in the MSDN documentation CHARACTER_OCTET_LENGTH is the length in bytes, and CHARACTER_MAXIMUM_LENGTH is the length in characters.
For parameters of type char or varchar they will be the same, but for parameters of type nchar or nvarchar they will be different, with OCTET-LENGTH being twice (usually if not always) the CHARACTER_LENGTH.
As the documentation says:
The LIMIT
clause can be used to constrain the number of rows returned by the SELECT
statement. LIMIT
takes one or two numeric arguments, which must both be nonnegative integer constants (except when using prepared statements).
With two arguments, the first argument specifies the offset of the first row to return, and the second specifies the maximum number of rows to return. The offset of the initial row is 0 (not 1)
.
The LIMIT
clause is used in the SELECT
statement to constrain the number of rows in a result set. The LIMIT
clause accepts one or two arguments. The values of both arguments must be zero or positive integer constants.
The following illustrates the LIMIT
clause syntax with 2 arguments:
SELECT * FROM tbl
LIMIT offset, count;
Let’s see what the offset and count mean in the LIMIT clause:
- The
offset
specifies the offset of the first row to return. The offset of the first row is 0, not 1.
- The
count
specifies maximum number of rows to return.
When you use LIMIT
with one argument, this argument will be used to specifies the maximum number of rows to return from the beginning of the result set.
SELECT * FROM tbl
LIMIT count;
The query above is equivalent to the following query with the LIMIT
clause that accepts two arguments:
SELECT * FROM tbl
LIMIT 0, count;
The LIMIT
clause often used with ORDER BY
clause. First, you use the ORDER BY
clause to sort the result set based on a certain criteria, and then you use LIMIT
clause to find lowest or highest values.
Best Answer
The table
mysql.user
is a MyISAM table that contains maps global database privileges. These privileges are mapped into INFORMATION_SCHEMA.USER_PRIVILEGES when MySQL is started.WARNING !!! Be careful running UPDATE commands against
mysql.user
. You could easily forget to runFLUSH PRIVILEGES;
.According to the MySQL Documentation on FLUSH PRIVILEGES
When you execute GRANT and REVOKE commands, the following authentication tables are changed
mysql.user
mysql.db
mysql.tables_priv
mysql.columns_priv
FLUSH TABLES;
is executed afterwards.You really have to know the table layouts to understand how to change privileges manually.
For example, I created a user called
pam@localhost
with the following privilegesWhat does
mysql.user
look like forpam@localhost
?What ??? Where are the SELECT privileges ???
They are located in
mysql.tables_priv
This is how mysqld expects user privileges to be organized and distributed in the grant tables.
If you update all the privileges in mysql.user for
pam@localhost
to 'Y' and runFLUSH PRIVILEGES;
, you will elevatepam@localhost
to a global superuser.This is why you are better off doing GRANT and REVOKE and trusting mysqld to get it right.