Страница 1 из 1
Проблема при сменен root password в Mysqld
Добавлено: 2013-07-15 13:31:13
yurec85
Проблема при запуске mysqld_safe. База находится /var/db/mysql, а при запуске mysqld_safe запускается с /etc/local/data/mysql: mysqld_safe Starting mysqld daemon with databases from /usr/local/data. Подскажите как решить данную ситуацию.
Re: Проблема при сменен root password в Mysqld
Добавлено: 2013-07-15 14:54:25
Alex Keda
это откуда такой путь странный?
Re: Проблема при сменен root password в Mysqld
Добавлено: 2013-07-15 15:24:31
yurec85
Alex Keda писал(а):
это откуда такой путь странный?
точнее с /usr/local/data. При этом скрипт /usr/local/etc/rc.d/mysql-server который выполняет запуск/остановку БД запускает процесс по правильному пути /var/db/mysql/. На сервере есть несколько баз проблем с доступом к которым нет.
ps -ax | grep mysqld
95999 ?? Is 0:00.01 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my.cnf --user=mysql --datadir=/var/db/mysql --pid-file=/var/db/mysql/
96095 ?? I 0:08.75 /usr/local/libexec/mysqld --defaults-extra-file=/var/db/mysql/my.cnf --basedir=/usr/local --datadir=/var/db/mysql --plugin-dir=/usr/local/li
90015 2 S+ 0:00.00 grep mysqld
Проблема в смене пароля для пользователя root. Команде mysqld_safe --skip-grant-tables запускается с неверным путём к базе:
mysqld_safe Starting mysqld daemon with databases from /usr/local/data
Re: Проблема при сменен root password в Mysqld
Добавлено: 2013-07-15 20:54:03
rayder
а можно узнать, что за ОС, какая версия мускуля, и все что касается настроек (а лучше еще их и показать)?
Re: Проблема при сменен root password в Mysqld
Добавлено: 2013-07-15 21:16:29
yurec85
FreeBSD, mysql-server-5.5.29
my.cnf
Код: Выделить всё
# The MySQL server
[mysqld]
port<--><------>= 3306
datadir= /var/db/mysql
socket<><------>= /tmp/mysql.sock
#log = /var/log/mysql.log
general_log=/var/log/mysql.log
skip-external-locking
key_buffer_size = 16K
max_allowed_packet = 1M
table_open_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 128K
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!
#.
#skip-networking
server-id<----->= 1
Re: Проблема при сменен root password в Mysqld
Добавлено: 2013-08-04 18:42:36
dml
1) Сделайте резерную копию, попробуйте переустановить MySQL-server или обновить до новой версии. Такое впечетление что повреджены файлы СУБД, возможно при некорректном завершении работы...
2) Халтурный вариант, но неплохое решение проблемы:
сделайте линк
Запускайте mysqld_safe
Делайте то что нужно, потом безболезненный
* При этом директория /var/db/mysql не удаляется
3) Предположим, что mysqld_safe принимает неправильный параметр. Не проблема
Код: Выделить всё
#man mysqld_safe
...
o --basedir=path
The path to the MySQL installation directory.
o --datadir=path
The path to the data directory.
o --defaults-extra-file=path
The name of an option file to be read in addition to the usual
option files. This must be the first option on the command line if
it is used. As of MySQL 5.0.6, if the file does not exist or is
otherwise inaccessible, the server will exit with an error.
o --defaults-file=file_name
The name of an option file to be read instead of the usual option
files. This must be the first option on the command line if it is
used.
o --ledir=path
If mysqld_safe cannot find the server, use this option to indicate
the path name to the directory where the server is located.
...
У меня выглядит так:
Код: Выделить всё
host# ps -auxww |grep mysql
mysql 1373 0,0 0,1 7064 1084 ?? Is 22июл13 0:00,01 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my.cnf --user=mysql --datadir=/var/db/mysql --socket=/tmp/mysql.sock --pid-file=/var/db/mysql/host.pid
mysql 1409 0,0 0,7 23672 6916 ?? S 22июл13 1:45,55 /usr/local/libexec/mysqld --defaults-extra-file=/var/db/mysql/my.cnf --basedir=/usr/local --datadir=/var/db/mysql --pid-file=/var/db/mysql/host.pid --port=3306 --socket=/tmp/mysql.sock
root 52566 0,0 0,1 7888 1400 p3 S+ 18:39 0:00,00 grep mysql
host#
Удачи!