Archive

Archive for the ‘My SQL’ Category

Mysql Permission To Single Table

GRANT SELECT,INSERT,UPDATE,DELETE ON database_name.table_name TO ‘USER’@'HOSTNAME’;

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: My SQL Tags: , ,

CURTIME() Vs NOW()

CURTIME() returns the TIME part of the current time.
NOW() returns the date and time portions as a timestamp in various formats, depending on how it was requested

Example

mysql> SELECT NOW(),CURDATE(),CURTIME();
+———————+————+———–+
| NOW() | CURDATE() | CURTIME() |
+———————+————+———–+
| 2012-06-18 14:14:01 | 2012-06-18 | 14:14:01 |
+———————+————+———–+
1 row in set (0.03 sec)

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: My SQL Tags: , , ,

The difference between MySQL CURTIME() and NOW()

CURTIME() returns the TIME part of the current time.
NOW() returns the date and time portions as a timestamp in various formats, depending on how it was requested

Example

mysql> SELECT NOW(),CURDATE(),CURTIME();
+———————+————+———–+
| NOW() | CURDATE() | CURTIME() |
+———————+————+———–+
| 2012-06-18 14:14:01 | 2012-06-18 | 14:14:01 |
+———————+————+———–+
1 row in set (0.03 sec)

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: My SQL Tags: , , ,

MySQL CURDATE() Vs NOW()

CURDATE() returns the DATE part of the current time.
NOW() returns the date and time portions as a timestamp in various formats, depending on how it was requested

Example

mysql> SELECT NOW(),CURDATE(),CURTIME();
+———————+————+———–+
| NOW() | CURDATE() | CURTIME() |
+———————+————+———–+
| 2012-06-18 14:14:01 | 2012-06-18 | 14:14:01 |
+———————+————+———–+
1 row in set (0.03 sec)

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: My SQL Tags: , , ,

The difference between MySQL CURDATE() and NOW()

CURDATE() returns the DATE part of the current time.
NOW() returns the date and time portions as a timestamp in various formats, depending on how it was requested

Example

mysql> SELECT NOW(),CURDATE(),CURTIME();
+———————+————+———–+
| NOW() | CURDATE() | CURTIME() |
+———————+————+———–+
| 2012-06-18 14:14:01 | 2012-06-18 | 14:14:01 |
+———————+————+———–+
1 row in set (0.03 sec)

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: My SQL Tags: , , , ,

Check BLACKHOLE storage engine is available

Run the following command

mysql> SHOW VARIABLES LIKE ‘have_blackhole_engine’;

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: My SQL Tags: , ,

BLACKHOLE storage engine

The BLACKHOLE storage engine accepts data but does not store anything . So on retrieval it will return nothing .

When we create BLACKHOLE table the server will create file with name starts with table name with extension .frm . No other tables will be generated as it stores nothing .

It supports all types of indexes .

Though nothing is stored , the query statements get stored if binary logs are enabled .

It does not support AUTO INCREMENT

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: My SQL Tags: , ,

CSV Storage Engine

The ARCHIVE storage engine is used for storing large amounts of data without indexes in a very small footprint.

When you create an ARCHIVE table, the server creates a table format file in the database directory. The file begins with the table name and has an .frm extension. The storage engine creates other files, all having names beginning with the table name. The data and metadata files have extensions of .ARZ and .ARM, respectively. An .ARN file may appear during optimization operations.

The ARCHIVE engine supports INSERT and SELECT, but not DELETE, REPLACE, or UPDATE. It does support ORDER BY operations, BLOB columns


EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: My SQL Tags: , ,

Switch to our mobile site