У меня проблема с mysql:
при выполнении любой mysql команды вылетает ошибка:
root@sedition:~# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
как это исправить?
Проблемы с Mysql
Модераторы: SLEDopit, Модераторы разделов
-
sedition
- Сообщения: 556
- ОС: Gentoo/MacOSX/Windows Vista
Проблемы с Mysql
Спасибо!
-
sarutobi
- Сообщения: 676
- Статус: Добрость и скромнота
- ОС: Debian 5, FreeBSD 6.2/8.0
Re: Проблемы с Mysql
ps aux | grep mysql
если вывел одну строку - сервис не запущен
#/etc/init.d/mysql start
и пробуем соединиться еще раз
если все работает - то настраиваем сервис mysqld на автозапуск (зависит от конкретоного дистрибутива)
Похоже у тебя именно этот случай
если вывел одну строку - сервис не запущен
#/etc/init.d/mysql start
и пробуем соединиться еще раз
если все работает - то настраиваем сервис mysqld на автозапуск (зависит от конкретоного дистрибутива)
Похоже у тебя именно этот случай
Fire and water, earth and sky - mistery surrounds us, legends never die!
-
sedition
- Сообщения: 556
- ОС: Gentoo/MacOSX/Windows Vista
Re: Проблемы с Mysql
root@sedition:~# ps aux | grep mysql
root 4009 0.0 0.2 1688 588 pts/1 R+ 15:21 0:00 grep mysql
кстати дистр - slackware
root 4009 0.0 0.2 1688 588 pts/1 R+ 15:21 0:00 grep mysql
кстати дистр - slackware
Спасибо!
-
kusok
- Сообщения: 306
- Статус: laid to rest
- ОС: Debian Sid
Re: Проблемы с Mysql
Ну очевидно, что mysqld не запущен.
# mysqld_safe &
Потом снова ps aux. Если снова пусто, значит смотри в логе, с какой ошибкой вылетел mysqld.
Кстати, а сам сервер-то установлен?
# mysqld_safe &
Потом снова ps aux. Если снова пусто, значит смотри в логе, с какой ошибкой вылетел mysqld.
Кстати, а сам сервер-то установлен?
-
sedition
- Сообщения: 556
- ОС: Gentoo/MacOSX/Windows Vista
Re: Проблемы с Mysql
Я думаю,что сервер установил
я ставил mysql-4.0.23a-i486-1.tgz
когда пытаюсь запустить вот что пишет
root@sedition:/etc/rc.d# Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid
060131 20:30:25 mysqld ended
такая вот фигня
(запускаю так: /etc/rc.d/rc.mysql start;дистр slackware)
в папке /var/run/mysql/ пусто
пожалуйста помогите мне
я ставил mysql-4.0.23a-i486-1.tgz
когда пытаюсь запустить вот что пишет
root@sedition:/etc/rc.d# Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid
060131 20:30:25 mysqld ended
такая вот фигня
(запускаю так: /etc/rc.d/rc.mysql start;дистр slackware)
в папке /var/run/mysql/ пусто
пожалуйста помогите мне
Спасибо!
-
kusok
- Сообщения: 306
- Статус: laid to rest
- ОС: Debian Sid
Re: Проблемы с Mysql
А в /var/lib/mysql/ или в /var/log/mysqld/ есть лог ошибок? Неплохо бы туда заглянуть.
Вообще, в /var/lib/mysql/ есть что-нибудь?
Вообще, в /var/lib/mysql/ есть что-нибудь?
-
sedition
- Сообщения: 556
- ОС: Gentoo/MacOSX/Windows Vista
Re: Проблемы с Mysql
root@sedition:/var/lib/mysql# ls
ib_arch_log_0000000000 ib_logfile0 ib_logfile1 ibdata1 sedition.err
sedition.err:
060131 20:30:21 mysqld started
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
060131 20:30:21 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
060131 20:30:21 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
060131 20:30:21 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
060131 20:30:22 InnoDB: Started
060131 20:30:22 Fatal error: Can't open privilege tables: Table 'mysql.host' doe
sn't exist
060131 20:30:22 Aborting
060131 20:30:22 InnoDB: Starting shutdown...
060131 20:30:25 InnoDB: Shutdown completed
060131 20:30:25 /usr/libexec/mysqld: Shutdown Complete
060131 20:30:25 mysqld ended
/var/log/mysql не существует
ib_arch_log_0000000000 ib_logfile0 ib_logfile1 ibdata1 sedition.err
sedition.err:
060131 20:30:21 mysqld started
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
060131 20:30:21 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
060131 20:30:21 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
060131 20:30:21 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
060131 20:30:22 InnoDB: Started
060131 20:30:22 Fatal error: Can't open privilege tables: Table 'mysql.host' doe
sn't exist
060131 20:30:22 Aborting
060131 20:30:22 InnoDB: Starting shutdown...
060131 20:30:25 InnoDB: Shutdown completed
060131 20:30:25 /usr/libexec/mysqld: Shutdown Complete
060131 20:30:25 mysqld ended
/var/log/mysql не существует
Спасибо!
-
kusok
- Сообщения: 306
- Статус: laid to rest
- ОС: Debian Sid
Re: Проблемы с Mysql
Код: Выделить всё
060131 20:30:22 InnoDB: Started
060131 20:30:22 Fatal error: Can't open privilege tables: Table 'mysql.host' doe
sn't exist
060131 20:30:22 AbortingНаверное в этом и кроется проблема.
Делай так:
# chown -R mysql:mysql /var/lib/mysql/
Если этот юзер не существует, добавь его.
# mysql_install_db
После этого запускай сервис.
-
TuLiss
- Сообщения: 1611
- Статус: 01100
- ОС: Gentoo,Ubuntu,MacOS X
Re: Проблемы с Mysql
1) идём в /etc/rc.d/
2) внимательно читаем файлик rc.mysql
3) делаем что надо
4) запускаем mysqld
5) пользуемся
6) радуемся жизни/пьём пиво
2) внимательно читаем файлик rc.mysql
3) делаем что надо
4) запускаем mysqld
5) пользуемся
6) радуемся жизни/пьём пиво
Чтение man'нов в слух ещЁ никому не помогало!...
kernel 4.2
chmod -x `which chmod`
War, war never changes...
kernel 4.2
chmod -x `which chmod`
War, war never changes...
-
sedition
- Сообщения: 556
- ОС: Gentoo/MacOSX/Windows Vista
Re: Проблемы с Mysql
root@sedition:/# chown -R mysql:mysql /var/lib/mysql/
root@sedition:/# mysql_install_db
Installing all prepared tables
060131 22:04:27 /usr/libexec/mysqld: Shutdown Complete
To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h sedition password 'new-password'
See the manual for more instructions.
NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com
root@sedition:/# /etc/rc.d/rc.mysqld start
root@sedition:/# Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid
060131 21:56:36 mysqld ended
root@sedition:/#less /var/lib/mysql/sedition.err
060131 21:51:46 mysqld started
060131 21:51:47 InnoDB: Started
060131 21:51:47 /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno:
13)
060131 21:51:47 Fatal error: Can't open privilege tables: Can't find file: './my
sql/host.frm' (errno: 13)
060131 21:51:47 Aborting
060131 21:51:47 InnoDB: Starting shutdown...
060131 21:51:49 InnoDB: Shutdown completed
060131 21:51:49 /usr/libexec/mysqld: Shutdown Complete
060131 21:51:49 mysqld ended
060131 21:53:47 mysqld started
060131 21:53:48 InnoDB: Started
060131 21:53:48 /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno:
13)
060131 21:53:48 Fatal error: Can't open privilege tables: Can't find file: './my
sql/host.frm' (errno: 13)
060131 21:53:48 Aborting
060131 21:53:48 InnoDB: Starting shutdown...
060131 21:53:50 InnoDB: Shutdown completed
060131 21:53:50 /usr/libexec/mysqld: Shutdown Complete
060131 21:53:50 mysqld ended
060131 21:56:07 mysqld started
060131 21:56:07 InnoDB: Started
060131 21:56:07 /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno:
13)
060131 21:56:07 Fatal error: Can't open privilege tables: Can't find file: './my
sql/host.frm' (errno: 13)
060131 21:56:07 Aborting
060131 21:56:07 InnoDB: Starting shutdown...
060131 21:56:09 InnoDB: Shutdown completed
060131 21:56:09 /usr/libexec/mysqld: Shutdown Complete
060131 21:56:09 mysqld ended
060131 21:56:33 mysqld started
060131 21:56:34 InnoDB: Started
060131 21:56:34 /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno:
13)
060131 21:56:34 Fatal error: Can't open privilege tables: Can't find file: './my
sql/host.frm' (errno: 13)
060131 21:56:34 Aborting
060131 21:56:34 InnoDB: Starting shutdown...
060131 21:56:36 InnoDB: Shutdown completed
060131 21:56:36 /usr/libexec/mysqld: Shutdown Complete
060131 21:56:36 mysqld ended
root@sedition:/# mysql_install_db
Installing all prepared tables
060131 22:04:27 /usr/libexec/mysqld: Shutdown Complete
To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h sedition password 'new-password'
See the manual for more instructions.
NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com
root@sedition:/# /etc/rc.d/rc.mysqld start
root@sedition:/# Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid
060131 21:56:36 mysqld ended
root@sedition:/#less /var/lib/mysql/sedition.err
060131 21:51:46 mysqld started
060131 21:51:47 InnoDB: Started
060131 21:51:47 /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno:
13)
060131 21:51:47 Fatal error: Can't open privilege tables: Can't find file: './my
sql/host.frm' (errno: 13)
060131 21:51:47 Aborting
060131 21:51:47 InnoDB: Starting shutdown...
060131 21:51:49 InnoDB: Shutdown completed
060131 21:51:49 /usr/libexec/mysqld: Shutdown Complete
060131 21:51:49 mysqld ended
060131 21:53:47 mysqld started
060131 21:53:48 InnoDB: Started
060131 21:53:48 /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno:
13)
060131 21:53:48 Fatal error: Can't open privilege tables: Can't find file: './my
sql/host.frm' (errno: 13)
060131 21:53:48 Aborting
060131 21:53:48 InnoDB: Starting shutdown...
060131 21:53:50 InnoDB: Shutdown completed
060131 21:53:50 /usr/libexec/mysqld: Shutdown Complete
060131 21:53:50 mysqld ended
060131 21:56:07 mysqld started
060131 21:56:07 InnoDB: Started
060131 21:56:07 /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno:
13)
060131 21:56:07 Fatal error: Can't open privilege tables: Can't find file: './my
sql/host.frm' (errno: 13)
060131 21:56:07 Aborting
060131 21:56:07 InnoDB: Starting shutdown...
060131 21:56:09 InnoDB: Shutdown completed
060131 21:56:09 /usr/libexec/mysqld: Shutdown Complete
060131 21:56:09 mysqld ended
060131 21:56:33 mysqld started
060131 21:56:34 InnoDB: Started
060131 21:56:34 /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno:
13)
060131 21:56:34 Fatal error: Can't open privilege tables: Can't find file: './my
sql/host.frm' (errno: 13)
060131 21:56:34 Aborting
060131 21:56:34 InnoDB: Starting shutdown...
060131 21:56:36 InnoDB: Shutdown completed
060131 21:56:36 /usr/libexec/mysqld: Shutdown Complete
060131 21:56:36 mysqld ended
Спасибо!
-
Electron
- Сообщения: 201
- ОС: Можно Windows написать? :-)
Re: Проблемы с Mysql
Хм, тебе же предложили создать системные таблицы(см. выше)! 
Gentoo Linux 2006.0 from Stage3-Pentium4 on Intel Celeron 2.1 Ghz, 512M RAM, NV GeForce 5200FX
-
sedition
- Сообщения: 556
- ОС: Gentoo/MacOSX/Windows Vista