LinuxForum.Fans
Тема

MySQL набор ошибок

Автор: sotariz 33 сообщений 11771 просмотров
#101535

Помогите пожалуйста со следующим:
Установил mysql на mandriva 2010

text
#urpmi mysql

все загрузилось, установилось, хотел зайти в mysql:

text
#mysql

в результате чего получил ошибку:

text
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

"погуглив" решил что проблема в правах доступа на папку /var/lib/mysql

text
#chmod -R 777 /var/lib/mysql

ошибка не устранилась, решил перезапустить sql:

text
#mysqld stop
mysqld: Table 'mysql.plugin' doesn't exist
101123  1:16:04 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
101123  1:16:04  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
101123  1:16:05  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...
101123  1:16:05  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
101123  1:16:06  InnoDB: Started; log sequence number 0 0
mysqld: Too many arguments (first extra is 'stop').
Use --verbose --help to get a list of available options
101123  1:16:06 [ERROR] Aborting

101123 1:16:06 InnoDB: Starting shutdown... 101123 1:16:08 InnoDB: Shutdown completed; log sequence number 0 44233 101123 1:16:08 [Note] mysqld: Shutdown complete

Сначала не обратил внимания что там пошли ошибки и дал команду старт

text
#mysqld start
mysqld: Table 'mysql.plugin' doesn't exist
101123  1:16:19 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
101123  1:16:19  InnoDB: Started; log sequence number 0 44233
mysqld: Too many arguments (first extra is 'start').
Use --verbose --help to get a list of available options
101123  1:16:19 [ERROR] Aborting

101123 1:16:19 InnoDB: Starting shutdown... 101123 1:16:21 InnoDB: Shutdown completed; log sequence number 0 44233 101123 1:16:21 [Note] mysqld: Shutdown complete

почитав полученное сообщение решил обновить:

text
#mysql_upgrade
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/lib/mysql/mysql.sock' 
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect
FATAL ERROR: Upgrade failed

Уже почитав здесь на форуме http://linuxforum.ru/viewtopic.php?id=5893 выполнил советы, но никакого результата...
Знаний у меня мало в этой области, потому очень надеюсь на помощь

#101539

Попробуй запустить скрипт /usr/bin/mysql_install_db. Рутом запускаешь?

#101541

щаз попробую, да запускал все рутом

#101550

# /usr/bin/mysql_install_db
Installing MySQL system tables...
OK
Filling help tables...
OK

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 server.mandriva password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd / ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd //mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available at http://www.mysql.com/
Support MySQL by buying support/licenses from http://shop.mysql.com/

# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

#101553
sotariz написал:

# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Сервер перезапусти после этого.
И еще попробовать зайти под mysqlовским рутом.

text

# mysql -u root -p
#101554

где тут ошибки... ?? он у вас просто не запущен....

#101558

# mysqld stop
InnoDB: Started; log sequence number 0 44233
101123 21:17:32 [ERROR] mysqld: unknown option '--federated'
101123 21:17:32 [ERROR] Aborting

101123 21:17:32 InnoDB: Starting shutdown...
101123 21:17:34 InnoDB: Shutdown completed; log sequence number 0 44233
101123 21:17:34 [Note] mysqld: Shutdown complete

# mysqld start
101123 21:17:40 InnoDB: Started; log sequence number 0 44233
101123 21:17:40 [ERROR] mysqld: unknown option '--federated'
101123 21:17:40 [ERROR] Aborting

101123 21:17:40 InnoDB: Starting shutdown...
101123 21:17:41 InnoDB: Shutdown completed; log sequence number 0 44233
101123 21:17:41 [Note] mysqld: Shutdown complete

# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

2odin, вот я и не могу его запустить

#101560

my.cnf, на всякий случай:

text
# A generic my.cnf file based on /usr/share/mysql/my-medium.cnf
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#

# The following options will be passed to all MySQL clients [client] user = root password = ********** port = 3306 socket = /var/lib/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server [mysqld] user = mysql datadir = /var/lib/mysql port = 3306 socket = /var/lib/mysql/mysql.sock pid-file = /var/run/mysqld/mysqld.pid skip-locking key_buffer = 16M max_allowed_packet = 32M table_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M collation_server = utf8_unicode_ci character_set_server = utf8

# plugins plugin_dir=/usr/lib/mysql/plugin #plugin-load=ha_archive.so;ha_blackhole.so;ha_innodb.so;ha_revision.so;ha_sphinx.so;libpbxt.so

# acivate the federated storage engine federated

# Default to using old password format for compatibility with old and # shorter password hash. # Reference: http://dev.mysql.com/doc/mysql/en/Password_hashing.html old_passwords

# 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 # (via the "enable-named-pipe" option) will render mysqld useless! # #skip-networking

# Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0

# Replication Master Server (default) # binary logging is required for replication #log-bin=mysql-bin

# required unique id between 1 and 2^32 - 1 # defaults to 1 if master-host is not set # but will not function as a master if omitted server-id = 1

# Replication Slave (comment out master section to use this) # # To configure this host as a replication slave, you can choose between # two methods : # # 1) Use the CHANGE MASTER TO command (fully described in our manual) - # the syntax is: # # CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>, # MASTER_USER=<user>, MASTER_PASSWORD=<password> ; # # where you replace <host>, <user>, <password> by quoted strings and # <port> by the master's port number (3306 by default). # # Example: # # CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, # MASTER_USER='joe', MASTER_PASSWORD='secret'; # # OR # # 2) Set the variables below. However, in case you choose this method, then # start replication for the first time (even unsuccessfully, for example # if you mistyped the password in master-password and the slave fails to # connect), the slave will create a master.info file, and any later # change in this file to the variables' values below will be ignored and # overridden by the content of the master.info file, unless you shutdown # the slave server, delete master.info and restart the slaver server. # For that reason, you may want to leave the lines below untouched # (commented) and instead use CHANGE MASTER TO (see above) # # required unique id between 2 and 2^32 - 1 # (and different from the master) # defaults to 2 if master-host is set # but will not function as a slave if omitted #server-id = 2 # # The replication master for this slave - required #master-host = <hostname> # # The username the slave will use for authentication when connecting # to the master - required #master-user = <username> # # The password the slave will authenticate with when connecting to # the master - required #master-password = <password> # # The port the master is listening on. # optional - defaults to 3306 #master-port = <port> # # binary logging - not required for slaves, but recommended #log-bin=mysql-bin

# Point the following paths to different dedicated disks tmpdir = /var/tmp #log-update = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables #bdb_cache_size = 4M #bdb_max_lock = 10000

# Uncomment the following if you are using InnoDB tables #innodb_data_home_dir = /var/lib/mysql/ #innodb_data_file_path = ibdata1:10M:autoextend #innodb_log_group_home_dir = /var/lib/mysql/ #innodb_log_arch_dir = /var/lib/mysql/ # You can set .._buffer_pool_size up to 50 - 80 % # of RAM but beware of setting memory usage too high #innodb_buffer_pool_size = 16M #innodb_additional_mem_pool_size = 2M # Set .._log_file_size to 25 % of buffer pool size #innodb_log_file_size = 5M #innodb_log_buffer_size = 8M #innodb_flush_log_at_trx_commit = 1 #innodb_lock_wait_timeout = 50

#bind-address=192.168.100.1

## Options for mysqld process: #ndbcluster # run NDB engine #ndb-connectstring=192.168.0.10 # location of MGM node

## Options for ndbd process: #[mysql_cluster] #ndb-connectstring=192.168.0.10 # location of MGM node

[mysqldump] quick max_allowed_packet = 16M

[mysql] no-auto-rehash # Remove the next comment character if you are not familiar with SQL #safe-updates default-character-set = utf8

[isamchk] key_buffer = 20M sort_buffer_size = 20M read_buffer = 2M write_buffer = 2M

[myisamchk] key_buffer = 20M sort_buffer_size = 20M read_buffer = 2M write_buffer = 2M

[mysqlhotcopy] interactive-timeout

[mysql.server] user=mysql basedir=/var/lib

[mysqld_safe] err-log=/var/log/mysqld/mysqld.log pid-file=/var/run/mysqld/mysqld.pid

# MySQL Instance Manager options section [manager] user=mysql default-mysqld-path=/usr/sbin/mysqld socket=/var/lib/mysql/mysqlmanager.sock pid-file=/var/run/mysqld/mysqlmanager.pid password-file=/etc/mysqlmanager.passwd run-as-service monitoring-interval=20 port=2273 #bind-address=192.168.100.1

#101562
text

# acivate the federated storage engine
federated

Закомментируй, т.е. символ # перед federated поставь. После этого

text

mysqld start

Вот это

text

mysql -u root -p

бесполезно делать, если сервер не запущен.

#101753

Так и не разобрался в чем была причина... удалил MySQL и все что было с ним связанно:

text
#urpme -a mysql

и следом все осиротевшие пакеты:

text
#uprme --auto-orphans

попытался установить заново:

text
#urpmi mysql

получил ошибку о невозможности установить пакет mysql-common из-за неосуществленных зависимостей (хотя должно было предложить установку всех необходимых пакетов, по крайней мере я так знаю/думаю) и больше никаких действий...
Решил снести систему и заново установить(глупо конечно, но проще чем биться головой о стену и не знать что исправлять), сейчас установил все заново, демон MYSQL стартует, никаких ошибок нет. Но при установке пароля пользователю root в файле /etc/my.cnf в терминале mysql выдает ошибку

text
mysql -u root -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

возвращаю строчку к исходному виду, комментирую ее, и вхожу в mysql без проблем

text
mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 184
Server version: 5.1.40 Mandriva Linux - MySQL Standard Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

это почему так? что я неверно делаю?...

#101770

по умолчанию пароля у root нету... что вы вводили и зачем... ?:)

#101771

Один из способов смены пароля

text

mysqladmin -u root -p password 'новыйпароль'

------
upd.
Если пароль не установлен, то тогда так

text

mysqladmin -u root password 'новыйпароль'
#101772

по умолчанию
#password = your_password
я делаю
password = бла-бла

#101774
sotariz написал:
по умолчанию
#password = your_password
я делаю
password = бла-бла

Я, сомневаюсь, что так можно сменить пароль. Никогда об этом не слышал. Но, если это возможно, то тогда надо сделать рестарт сервера, чтобы он конфиги "перечитал".

#101781

[root@localhost ~]# mysqladmin -u root password ´новый_пароль´
[root@localhost ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@localhost ~]# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@localhost ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@localhost ~]#

#101783
mycetophylax написал:
[quote=sotariz]по умолчанию
#password = your_password
я делаю
password = бла-бла

Я, сомневаюсь, что так можно сменить пароль. Никогда об этом не слышал. Но, если это возможно, то тогда надо сделать рестарт сервера, чтобы он конфиги "перечитал".[/quote]
он сразу реагировал на изменение конфига, снимал коммент - не пускал в мускул, возвращал - входил без проблем

#101802
sotariz написал:
[root@localhost ~]# mysqladmin -u root password ´новый_пароль´

Апострофы надо было (на клавише с буквой Э), а не эти значки, я даже и не знаю как они называются :D .
Он так пароль не поменял.

#101808

вот ступил :D спасибо! думал это листинг такой :rolleyes:

#101813

2mycetophylax, подскажи где найти конфиг phpMyAdmin и как его состыковать с мускулом, пожалуйста... :rolleyes:

#101817
sotariz написал:
2mycetophylax, подскажи где найти конфиг phpMyAdmin и как его состыковать с мускулом, пожалуйста... :rolleyes:

Вот чего не знаю - того не знаю :D . С php, phpMyAdmin дела никогда не имел. Слышал только, что это вебморда для администрирования MySQL. На этом мои познания об этом предмете закончились wink

Войдите или зарегистрируйтесь, чтобы ответить.