# Главная
# О библиотеке

# Выбор дистрибутива
преимущества Linux/UNIX | основные дистрибутивы | серверный Linux | BSD | LiveCDs | прочее

# Установка и удаление программ
общие вопросы | каталоги софта | специальные случаи

# Настройка и работа
установка, загрузчики | настройка Linux | консоль | файловые системы | процессы | шеллы, русификация, коммандеры | виртуальные машины, эмуляторы

# X Window и оконные менеджеры
настройка X Window | GNOME | KDE | IceWM и др.

# Работа с текстами
редакторы | офис | шрифты, кодировки и русификация | преобразования текстовых файлов | LaTeX, SGML и др. | словари

# Графика
GIMP | фото | обработка изображений | форматы графических файлов

# Сети, администрирование
общие вопросы | Dialup & PPP | брандмауэры | маршрутизация | работа в Windows-сетях | веб-серверы | Apache | прокси-серверы | сетевая печать | прочее

# Программирование
GCC & GNU make | программирование в UNIX | графические библиотеки | Tcl | Perl | PHP | Java & C# | СУБД | CVS | прочее

# Ядро
# Мультимедиа
# Интернет
# Почта
# Безопасность
# Железо
# Разное

# Linux HowTo (как сделать)
# Книги и руководства
# Материалы на английском языке


MySQL The World's Most Popular Open Source Database # Online shop | Site map |  
CompanyProductsSupport & ConsultingTraining & CertificationDownloadsDocumentation
  BooksArticlesMailing ListsPresentationsOther Sites  
Search the MySQL manual:
MySQL Manual
  • A Проблемы и распространенные ошибки
    • A.4 Вопросы, связанные с администрированием
      • A.4.1 Что делать, если работа MySQL сопровождается постоянными сбоями
      • A.4.2 Как переустановить забытый пароль пользователя root
      • A.4.3 Как MySQL реагирует на переполнение диска
      • A.4.4 Где MySQL хранит временные файлы
      • A.4.5 Как защитить или изменить сокет-файл MySQL `/tmp/mysql.sock'
      • A.4.6 Проблемы с часовыми поясами

Buy this Reference Manual in softcover from Barnes & Noble!

MySQL Reference Manual
Previous / Next / Up / Table of Contents

A.4.6 Проблемы с часовыми поясами

Если есть проблема с тем, что SELECT NOW() возвращает значения GMT, а не местное время, то необходимо установить переменную окружения TZ равной местному часовому поясу. Это должно быть сделано для окружения, в котором работает сервер, например, в safe_mysqld или mysql.server (see section F Переменные окружения).

User Comments

Posted by [name withheld] on Friday May 17 2002, @6:24am[Delete] [Edit]

I am having problems using the mysqladmin
program in 3).

Connecting with the mysql client works just fine
though :-)

Posted by Hardly Boffin on Wednesday December 18 2002, @5:28pm[Delete] [Edit]

As a new user i find this very confusing..

I was able to find another refference with easier
examples at http://www.codebits.com/bit.cfm?BitID=120

1. /usr/local/mysql/bin/safe_mysqld
--skip-grant-tables &

2. /usr/local/mysql

3. use mysql;

4. update user set password = password('.......')
where user = 'root' and host='localhost';

5. Stop and Start the MySQL server.

Posted by [name withheld] on Friday May 17 2002, @6:24am[Delete] [Edit]

Restart mysqld with the --skip-grant-tables
option.
Yes, quite confusing. Especially point #3 and
the "Note":

3. Connect to the mysqld server with mysql -h
hostname mysql and change the password with a
GRANT command. See section 4.3.1 GRANT and REVOKE
Syntax. You can also do this with mysqladmin -h
hostname -u user password 'new password'

"Note that after you started mysqld with --skip-
grant-tables, any usage of GRANT commands will
give you an Unknown command error until you have
executed FLUSH PRIVILEGES."

Posted by Rusty Carruth on Wednesday December 18 2002, @5:27pm[Delete] [Edit]

Let me try to help clarify with a howto:

First, set things up:

log in as root.
stop mysql (/etc/rc.d/init.d/mysql stop)
start mysql in ignore mode (/usr/bin/safe_mysqld
--skip-grant-tables &)

now, change the password for root user:

mysql -p
<enter root password? if requested, or don't use
the -p option>
use mysql;
update user set password=password('newpass');
quit
/etc/rc.d/init.d/mysql stop # Stop the insecure
server
/etc/rc.d/init.d/mysql start # restart it in
normal mode

Ok,now root's password is 'newpass'. Now, to
change password for user 'joe_user', do this as
root:

mysqladmin -u joe_user password newpass -p
(enter root password - newpass in this case)

Repeat for all users (bug please don't use
'newpass' as the password!).

I wish I had found a way to do this without having
to type the new password on the command line, but
I could not. Hopefully someone else will figure
it out and comment here...

Hope this saves someone the time *I* spent on
this!

rc

Posted by Richard Lloyd on Friday May 17 2002, @6:24am[Delete] [Edit]

I just downloaded the Linux 3.23.49a RPMs and the
default location for the creation of mysql.sock is
NOT /tmp !! It's actually in /var/lib/mysql. This is
quite serious because not only doesn't this match
all the online docs and mysqld man page, it also
causes a problem if MySQL isn't running when you
configure PHP because the latter defaults to
/tmp/mysql.sock and if you then try to connect
locally to mysql via PHP, it'll fail.

Posted by [name withheld] on Wednesday December 18 2002, @5:28pm[Delete] [Edit]

Example:
safe_mysqld -O max_connections=300 --timezone=GMT-
2.

It doesn't seem like MySQL understands anything
else than GMT[+][-]X

Add your own comment.

Top / Previous / Next / Up / Table of Contents
# MySQL.com home | Site map | Contact us | Press | Jobs | Privacy policy | Trademark info | © 1995-2003 MySQL AB. All rights reserved.