|
Nie mogę się dostać do MySQL - instalacja
MaestroS - 05-01-2009 17:31
Problem jest w poleceniu (mysql -u root). Nie mogę się dostać do MySQL ani przez konsolę, ani przez phpMyAdmin. Co jest?
grzesiek - 05-01-2009 17:59
Nie :!: Problem jest w tym mysqladmin -u root password 'password'
Theq - 05-01-2009 18:02
http://yampress.dug.net.pl/doku.php?id=serwer_mysql
MaestroS - 05-01-2009 18:26
To i tak nic nie daje:
mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: NO)'
Tak jest nawet jak przeinstaluje wszystkie pakiety. Nie wiem, co się dzieje.
A jak wpiszę: mysqld
ks23098:/# mysqld InnoDB: Unable to lock ./ibdata1, error: 11 InnoDB: Check that you do not already have another mysqld process InnoDB: using the same InnoDB data or log files. 090105 18:25:26 InnoDB: Retrying to lock the first data file InnoDB: Unable to lock ./ibdata1, error: 11 InnoDB: Check that you do not already have another mysqld process InnoDB: using the same InnoDB data or log files. InnoDB: Unable to lock ./ibdata1, error: 11 InnoDB: Check that you do not already have another mysqld process InnoDB: using the same InnoDB data or log files. InnoDB: Unable to lock ./ibdata1, error: 11 InnoDB: Check that you do not already have another mysqld process InnoDB: using the same InnoDB data or log files.
Na poprzednim serwerze dedykowanym nic takiego nie miało miejsca. Akurat na moim MySQL nie chce w ogóle działać. Skorzystałem już dla ,,cukrowanej'' pewności z 3 opisów i nic.
grzesiek - 05-01-2009 19:14
Ech musisz coś źle wpisywać. Kolejności jest taka: instalujesz, ustawiasz hasło dla roota. A ten:
co pokazywałeś to tak jak tam jest napisane - już jest uruchomiony.
MaestroS - 05-01-2009 19:32
grzesiek, jeżeli spojrzysz wyżej, to możesz zauważyć, że pomimo tego, że mysqld już działa, to:
mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: NO)'
I tu jest pies pogrzebany.
grzesiek - 05-01-2009 19:54
A to informuje, iż logowałeś się na root@localhot ale nie podałeś parametru -p (hasło)
MaestroS - 05-01-2009 20:02
Ale ja nie wiem jakie mam hasło! Puste nie działa, a jeszcze go nie ustawiałem. Ten błąd pojawia się za każdym razem. Przy każdej próbie logowania, czy zmiany hasła.
grzesiek - 05-01-2009 20:10
Ten cały komunikat to jedno i to samo. Pierwsza linia mówi, że nie udało się logowanie, a druga to zawartość błędu zwróconego przez funkcję logowania, czyli dlaczego logowanie się nie udało.
Więc tak instalujesz MySQL wpisujesz:
mysqladmin -u root password haslo
a potem:
mysql -u root -p (prosi o hasło) hasło
i otrzymujesz komunikat?
mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: NO)'
:evil:
MaestroS - 05-01-2009 20:29
Specjalnie dla Ciebie:
ks23098:~# mysqladmin -u root password przyklad mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: NO)'
ks23098:~# mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) ks23098:~#
Czy to nie wynikało z moich postów?
grzesiek - 05-01-2009 20:41
A pokaż konfig i w między czasie spróbuj bez podawania hasła np. mysqladmin -u root mysqladmin -u root password mysqladmin -u root -p
Ale przedewszystkiem sprawdz czy mysql dziła ps -A | grep mysql
Nic nie zmieniałeś w localhost=127.0.0.1?
dsue - 05-01-2009 20:45
Napisz co ci daje komenda: ps ax|grep mysql
i nie uruchamiałbym mysqla przez mysqld tylko /etc/init.d/mysql start (albo restart)
Pozdrawiam
MaestroS - 05-01-2009 20:52
ps -A | grep mysql 4879 ? 00:00:00 mysqld_safe 4918 ? 00:00:01 mysqld
ps ax | grep mysql mysqladmin -u root
ks23098:~# mysqladmin -u root mysqladmin Ver 8.41 Distrib 5.0.51a, for debian-linux-gnu on i486 Copyright (C) 2000-2006 MySQL AB This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL license
Administration program for the mysqld daemon. Usage: mysqladmin [OPTIONS] command command.... -c, --count=# Number of iterations to make. This works with -i (--sleep) only. -#, --debug[=name] Output debug log. Often this is 'd:t:o,filename'. -f, --force Don't ask for confirmation on drop database; with multiple commands, continue even if an error occurs. -C, --compress Use compression in server/client protocol. --character-sets-dir=name Directory where character sets are. --default-character-set=name Set the default character set. -?, --help Display this help and exit. -h, --host=name Connect to host. -p, --password[=name] Password to use when connecting to server. If password is not given it's asked from the tty. WARNING: Providing a password on command line is insecure as it is visible through /proc to anyone for a short time. -P, --port=# Port number to use for connection. --protocol=name The protocol of connection (tcp,socket,pipe,memory). -r, --relative Show difference between current and previous values when used with -i. Currently works only with extended-status. -O, --set-variable=name Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value. -s, --silent Silently exit if one can't connect to server. -S, --socket=name Socket file to use for connection. -i, --sleep=# Execute commands again and again with a sleep between. --ssl Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl. --ssl-ca=name CA file in PEM format (check OpenSSL docs, implies --ssl). --ssl-capath=name CA directory (check OpenSSL docs, implies --ssl). --ssl-cert=name X509 cert in PEM format (implies --ssl). --ssl-cipher=name SSL cipher to use (implies --ssl). --ssl-key=name X509 key in PEM format (implies --ssl). --ssl-verify-server-cert Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default. -u, --user=name User for login if not current user. -v, --verbose Write more information. -V, --version Output version information and exit. -E, --vertical Print output vertically. Is similar to --relative, but prints output vertically. -w, --wait[=#] Wait and retry if connection is down. --connect_timeout=# --shutdown_timeout=#
Variables (--variable-name=value) and boolean options {FALSE|TRUE} Value (after reading options) --------------------------------- ----------------------------- count 0 force FALSE compress FALSE character-sets-dir (No default value) default-character-set (No default value) host (No default value) port 3306 relative FALSE socket /var/run/mysqld/mysqld.sock sleep 0 ssl FALSE ssl-ca (No default value) ssl-capath (No default value) ssl-cert (No default value) ssl-cipher (No default value) ssl-key (No default value) ssl-verify-server-cert FALSE user root verbose FALSE vertical FALSE connect_timeout 43200 shutdown_timeout 3600
Default options are read from the following files in the given order: /etc/mysql/my.cnf ~/.my.cnf /usr/etc/my.cnf The following groups are read: mysqladmin client The following options may be given as the first argument: --print-defaults Print the program argument list and exit --no-defaults Don't read default options from any options file --defaults-file=# Only read default options from the given file # --defaults-extra-file=# Read this file after the global files are read
Where command is a one or more of: (Commands may be shortened) create databasename Create a new database debug Instruct server to write debug information to log drop databasename Delete a database and all its tables extended-status Gives an extended status message from the server flush-hosts Flush all cached hosts flush-logs Flush all logs flush-status Clear status variables flush-tables Flush all tables flush-threads Flush the thread cache flush-privileges Reload grant tables (same as reload) kill id,id,... Kill mysql threads password new-password Change old password to new-password, MySQL 4.1 hashing. old-password new-password Change old password to new-password in old format.
ping Check if mysqld is alive processlist Show list of active threads in server reload Reload grant tables refresh Flush all tables and close and open logfiles shutdown Take server down status Gives a short status message from the server start-slave Start slave stop-slave Stop slave variables Prints variables available version Get version info from server
I działa.
grzesiek - 05-01-2009 21:00
A config?
MaestroS - 05-01-2009 21:08
Chyba nie trudno się domyślić, że w ogóle go nie ruszałem, jest domyślny, ale cóż ...
# # The MySQL database server configuration file. # # You can copy this to one of: # - "/etc/mysql/my.cnf" to set global options, # - "~/.my.cnf" to set user-specific options. # # One can use all long options that the program supports. # Run program with --help to get a list of available options and with # --print-defaults to see which it would actually understand and use. # # For explanations see # http://dev.mysql.com/doc/mysql/en/se...variables.html
# This will be passed to all mysql clients # It has been reported that passwords should be enclosed with ticks/quotes # escpecially if they contain "#" chars... # Remember to edit /etc/mysql/debian.cnf when changing the socket location. [client] port = 3306 socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs # The following values assume you have at least 32M ram
# This was formally known as [safe_mysqld]. Both versions are currently parsed. [mysqld_safe] socket = /var/run/mysqld/mysqld.sock nice = 0
[mysqld] # # * Basic Settings # user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp language = /usr/share/mysql/english skip-external-locking # # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. bind-address = 127.0.0.1 # # * Fine Tuning # key_buffer = 16M max_allowed_packet = 16M thread_stack = 128K thread_cache_size = 8 # This replaces the startup script and checks MyISAM tables if needed # the first time they are touched myisam-recover = BACKUP #max_connections = 100 #table_cache = 64 #thread_concurrency = 10 # # * Query Cache Configuration # query_cache_limit = 1M query_cache_size = 16M # # * Logging and Replication # # Both location gets rotated by the cronjob. # Be aware that this log type is a performance killer. #log = /var/log/mysql/mysql.log # # Error logging goes to syslog. This is a Debian improvement :) # # Here you can see queries with especially long duration #log_slow_queries = /var/log/mysql/mysql-slow.log #long_query_time = 2 #log-queries-not-using-indexes # # The following can be used as easy to replay backup logs or for replication. # note: if you are setting up a replication slave, see README.Debian about # other settings you may need to change. #server-id = 1 #log_bin = /var/log/mysql/mysql-bin.log expire_logs_days = 10 max_binlog_size = 100M #binlog_do_db = include_database_name #binlog_ignore_db = include_database_name # # * BerkeleyDB # # Using BerkeleyDB is now discouraged as its support will cease in 5.1.12. skip-bdb # # * InnoDB # # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. # Read the manual for more InnoDB related options. There are many! # You might want to disable InnoDB to shrink the mysqld process by circa 100MB. #skip-innodb # # * Security Features # # Read the manual, too, if you want chroot! # chroot = /var/lib/mysql/ # # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". # # ssl-ca=/etc/mysql/cacert.pem # ssl-cert=/etc/mysql/server-cert.pem # ssl-key=/etc/mysql/server-key.pem
[mysqldump] quick quote-names max_allowed_packet = 16M
[mysql] #no-auto-rehash # faster start of mysql but no tab completition
[isamchk] key_buffer = 16M
# # * NDB Cluster # # See /usr/share/doc/mysql-server-*/README.Debian for more information. # # The following configuration is read by the NDB Data Nodes (ndbd processes) # not from the NDB Management Nodes (ndb_mgmd processes). # # [MYSQL_CLUSTER] # ndb-connectstring=127.0.0.1
# # * IMPORTANT: Additional settings that can override those from this file! # The files must end with '.cnf', otherwise they'll be ignored. # !includedir /etc/mysql/conf.d/
grzesiek - 05-01-2009 21:52
Pokaż wynik polecenie netstat -ltnp | grep :3306
oraz ls /var/run/mysqld/ | grep mysqld.sock
oraz cat /etc/hosts | grep localhost
Sprawdz czy MySQL uruchomi się gdy zakomentujesz opcję
bind-address = 127.0.0.1
Z tego co widzę to masz logi wyłączone, odkomentuj opcję
#log = /var/log/mysql/mysql.log
spróbuj ustawić hasło roota i pokaż logi.
Na razie to wszystko co mi przychodzi do głowy. Zostaje jeszcze zrestartować kompa (ale to już na pewno robiłeś), a nawet zostawić to do jutra, może jutro zacznie działać ;-) kto wie.
MaestroS - 05-01-2009 22:04
netstat -ltnp | grep :3306 tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 4918/mysqld
ls /var/run/mysqld/ | grep mysqld.sock mysqld.sock
cat /etc/hosts | grep localhost 127.0.0.1 localhost.localdomain localhost ::1 ip6-localhost ip6-loopback Poza tym, MySQL działa, widać w procesach. A co do tego logu, to próbowałem zmienić hasło i: 24 Quit 25 Connect debian-sys-maint@localhost on 25 Query select @@version_comment limit 1 25 Query select count(*) into @discard from `mysql`.`time_zone_transition` 25 Quit 26 Connect debian-sys-maint@localhost on 26 Query select @@version_comment limit 1 26 Query select count(*) into @discard from `mysql`.`time_zone_transition_type` 26 Quit 090105 22:02:41 27 Connect debian-sys-maint@localhost on 27 Query select @@version_comment limit 1 27 Query select count(*) into @discard from `mysql`.`user` 27 Quit 090105 22:02:53 28 Connect Access denied for user 'root'@'localhost' (using password: NO) 090105 22:03:05 29 Connect Access denied for user 'root'@'localhost' (using password: NO)
grzesiek - 05-01-2009 22:25
Nie wiem co jest grane. Ale po głowie chodzi mi coś takiego, że może paczka jest walnięta albo się źle ściągneła. Czy przed ponownym zainstalowaniem wyczyściłeś cacha apt? Bo on przechowuje paczki już raz pobrane. może Wyczyść te jego cacha i jeszcze raz spróbuj - jak masz jeszcze siły.
MaestroS - 05-01-2009 23:40
Nieaktualne.
zanotowane.pldoc.pisz.plpdf.pisz.plminister.pev.pl
|