If you have problems with the fact that anyone can delete the
MySQL communication socket `/tmp/mysql.sock', you can,
on most versions of Unix, protect your `/tmp' filesystem by setting
the sticky
bit on it. Log in as root
and do the following:
shell> chmod +t /tmp
This will protect your `/tmp' filesystem so that files can be deleted
only by their owners or the superuser (root
).
You can check if the sticky
bit is set by executing ls -ld /tmp
.
If the last permission bit is t
, the bit is set.
You can change the place where MySQL uses / puts the socket file the following ways:
/etc/my.cnf
:
[client] socket=path-for-socket-file [mysqld] socket=path-for-socket-fileSee section 4.1.2 `my.cnf' Option Files.
mysqld_safe
and most
clients with the --socket=path-for-socket-file
option.
MYSQL_UNIX_PORT
environment
variable.
configure
option
--with-unix-socket-path=path-for-socket-file
. See section 2.3.3 Typical configure
Options.
You can test that the socket works with this command:
shell> mysqladmin --socket=/path/to/socket version
Posted by [name withheld] on Friday June 14 2002, @12:58pm | [Delete] [Edit] |
My time zone is EDT, and I'm inserting a DateTime
value of "2002-10-27 01:00:00". This datetime
happens to be on the night that we come off of
Daylight savings time, so at 2am the clock goes
back 1 hour and it's 1am again. So 1am occurs
twice during this day and my insert is
ambiguous. Which "1am" will get inserted the
first or the second occurance? Well when I do
the insert, the datetime seems to go in as the
second occurance (6am GMT). How can I insert a
datetime value that refers to the first 1am??
(the one that occurs at 5am GMT)??? Is there any
way to insert and retrieve a datetime using GMT?
Posted by [name withheld] on Wednesday December 18 2002, @5:29pm | [Delete] [Edit] |
Is there any way to insert and retrieve a
datetime using GMT?You could use
seconds from epoch; i.e. a UNIX timestamp.