2016-07-15 3 views
1

デフォルト値のインストールを使用して、私はmysql 5.7.13をインストールしました。 https://dev.mysql.com/doc/refman/5.7/en/installing-source-distribution.html
ここで指示されたとおりにデータディレクトリを初期化しました:https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization.html
これは私のubuntu 14.04サーバーにインストールされています。この使用してサーバを起動するmysql 5.7.13ソースインストールでmysqld.sockが作成されない

bin/mysqld_safe --user=mysql & 

は、ログファイルのerror.logファイルをチェックするために私に指示します。

mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) while connecting to the MySQL server Upgrade process encountered error and will not continue.

問題は、靴下のファイルがどこにも存在しないということである: Error.logですが、私が言ってエラーメッセージが表示されます

2016-07-15T22:16:43.460297Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 
2016-07-15T22:16:43.862401Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see$ 
2016-07-15T22:16:43.863013Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider$ 
2016-07-15T22:16:43.863502Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.13) starting as process 1996 ... 
2016-07-15T22:16:43.864532Z 0 [ERROR] Can't find error-message file '/usr/share/mysql/errmsg.sys'. Check error-message file location and 'lc-messages-dir' c$ 
2016-07-15T22:16:43.893029Z 0 [Note] InnoDB: PUNCH HOLE support available 
2016-07-15T22:16:43.893057Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
2016-07-15T22:16:43.893080Z 0 [Note] InnoDB: Uses event mutexes 
2016-07-15T22:16:43.893084Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 
2016-07-15T22:16:43.893086Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 
2016-07-15T22:16:43.894664Z 0 [Note] InnoDB: Number of pools: 1 
2016-07-15T22:16:43.902772Z 0 [Note] InnoDB: Using CPU crc32 instructions 
2016-07-15T22:16:43.908310Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 
2016-07-15T22:16:43.932802Z 0 [Note] InnoDB: Completed initialization of buffer pool 
2016-07-15T22:16:43.942146Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of se$ 
2016-07-15T22:16:43.952791Z 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created! 
2016-07-15T22:16:43.952931Z 0 [Note] InnoDB: Setting file './ibdata1' size to 12 MB. Physically writing the file full; Please wait ... 
2016-07-15T22:16:44.015448Z 0 [Note] InnoDB: File './ibdata1' size is now 12 MB. 
2016-07-15T22:16:44.015683Z 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB 
2016-07-15T22:16:44.197808Z 0 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB 
2016-07-15T22:16:44.296354Z 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0 
2016-07-15T22:16:44.296394Z 0 [Warning] InnoDB: New log files created, LSN=45790 
2016-07-15T22:16:44.296404Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables 
2016-07-15T22:16:44.296422Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 
2016-07-15T22:16:44.319575Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. 
2016-07-15T22:16:44.319763Z 0 [Note] InnoDB: Doublewrite buffer not found: creating new 
2016-07-15T22:16:44.340836Z 0 [Note] InnoDB: Doublewrite buffer created 
2016-07-15T22:16:44.345684Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. 
2016-07-15T22:16:44.345696Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. 
2016-07-15T22:16:44.345779Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. 
2016-07-15T22:16:44.353886Z 0 [Note] InnoDB: Foreign key constraint system tables created 
2016-07-15T22:16:44.353917Z 0 [Note] InnoDB: Creating tablespace and datafile system tables. 
2016-07-15T22:16:44.354865Z 0 [Note] InnoDB: Tablespace and datafile system tables created. 
2016-07-15T22:16:44.354886Z 0 [Note] InnoDB: Creating sys_virtual system tables. 
2016-07-15T22:16:44.355467Z 0 [Note] InnoDB: sys_virtual table created 
2016-07-15T22:16:44.356452Z 0 [Note] InnoDB: Waiting for purge to start 
2016-07-15T22:16:44.406828Z 0 [Note] InnoDB: 5.7.13 started; log sequence number 0 
2016-07-15T22:16:44.406972Z 0 [Note] Plugin 'FEDERATED' is disabled. 
mysqld: Unknown error 1146 
2016-07-15T22:16:44.408277Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 
2016-07-15T22:16:44.408377Z 0 [ERROR] unknown variable 'key_buffer=16M' 
2016-07-15T22:16:44.408381Z 0 [ERROR] Aborting 


2016-07-15T22:16:44.408393Z 0 [Note] Binlog end 
2016-07-15T22:16:44.408425Z 0 [Note] Shutting down plugin 'ngram' 
2016-07-15T22:16:44.408428Z 0 [Note] Shutting down plugin 'partition' 
2016-07-15T22:16:44.408430Z 0 [Note] Shutting down plugin 'BLACKHOLE' 
2016-07-15T22:16:44.408433Z 0 [Note] Shutting down plugin 'ARCHIVE' 
2016-07-15T22:16:44.408435Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA' 
2016-07-15T22:16:44.408477Z 0 [Note] Shutting down plugin 'MEMORY' 
2016-07-15T22:16:44.408480Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL' 
2016-07-15T22:16:44.408482Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES' 
2016-07-15T22:16:44.408483Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES' 
2016-07-15T22:16:44.408485Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS' 
2016-07-15T22:16:44.408486Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN' 
2016-07-15T22:16:44.408488Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS' 
2016-07-15T22:16:44.408490Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS' 
2016-07-15T22:16:44.408491Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES' 
2016-07-15T22:16:44.408493Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS' 
2016-07-15T22:16:44.408494Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES' 
2016-07-15T22:16:44.408496Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE' 
2016-07-15T22:16:44.408497Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE' 
2016-07-15T22:16:44.408499Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG' 
2016-07-15T22:16:44.408500Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED' 
2016-07-15T22:16:44.408502Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED' 
2016-07-15T22:16:44.408503Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD' 
2016-07-15T22:16:44.408505Z 0 [Note] Shutting down plugin 'INNODB_METRICS' 
2016-07-15T22:16:44.408506Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO' 
2016-07-15T22:16:44.408508Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS' 
2016-07-15T22:16:44.408510Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU' 
2016-07-15T22:16:44.408511Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE' 
2016-07-15T22:16:44.408513Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET' 
2016-07-15T22:16:44.408514Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX' 
2016-07-15T22:16:44.408516Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET' 
2016-07-15T22:16:44.408517Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM' 
2016-07-15T22:16:44.408519Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET' 
2016-07-15T22:16:44.408520Z 0 [Note] Shutting down plugin 'INNODB_CMP' 
2016-07-15T22:16:44.408522Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS' 
2016-07-15T22:16:44.408523Z 0 [Note] Shutting down plugin 'INNODB_LOCKS' 
2016-07-15T22:16:44.408525Z 0 [Note] Shutting down plugin 'INNODB_TRX' 
2016-07-15T22:16:44.408526Z 0 [Note] Shutting down plugin 'InnoDB' 
2016-07-15T22:16:44.408548Z 0 [Note] InnoDB: FTS optimize thread exiting. 

そしてmysql_updgrade

bin/mysql_upgrade 

を起動すると言います。それは存在しません。私はfindlocateを使って検索しました。私はそれが私のサーバ上のどこにもないことを100%確信しています。これらのデフォルト値の/etc/mysql/my.cnf

# 
# 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/server-system-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 
lc-messages-dir = /usr/share/mysql 
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   = 192K 
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. 
# As of 5.1 you can enable the log at runtime! 
#general_log_file  = /var/log/mysql/mysql.log 
#general_log    = 1 
# 
# Error log - should be very few entries. 
# 
log_error = /var/log/mysql/error.log 
# 
# 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 
#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 
# 
# * 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! 
# 
# * 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 

# 
# * 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/ 
[isamchk] 
key_buffer    = 16M 

# 
# * 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/ 

なしにmy.cnfを見ては正しいです。だから私はmy.cnfファイルを適切にすべての場所に一致する変更しました。 mySQLは/ usr/local/mysqlにインストールされています。

変化したmy.cnfファイル:

# 
# 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/server-system-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] 
#host   = 127.0.0.1 
port   = 3306 
socket   = /tmp/mysql.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   = /tmp/mysql.sock 
nice   = 0 

[mysqld] 
# 
# * Basic Settings 
# 
user   = mysql 
pid-file  = /tmp/mysqld.pid 
socket   = /tmp/mysqld.sock 
port   = 3306 
basedir   = /usr/local/mysql 
datadir   = /usr/local/mysql/data 
tmpdir   = /tmp 
lc-messages-dir = /usr/local/mysql/share 
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   = 192K 
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. 
# As of 5.1 you can enable the log at runtime! 
#general_log_file  = /var/log/mysql/mysql.log 
#general_log    = 1 
# 
# Error log - should be very few entries. 
# 
log_error = /usr/local/mysql/data/error.log 
# 
# 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 
# 
# * 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! 
# 
# * 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 

# 
# * 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/ 

は今、私はまだ同じ問題を取得しています。 my.cnfがどのフォルダに属していても、どのアクセス権に関係なく、ソケットファイルは単に作成されていません。私はファイル自体を作成しようとしましたが、同じ結果が得られます。
はい、my.cnfがmySQLのデフォルトファイルであることを確認しました。ポートはiptablesで開かれており、mySQLユーザはmysql設定が指示しているすべてのファイルに対する所有権/アクセス権を持っています。

私はこれを、apache2がインストールされたUbuntu 14.04サーバーで実行しています。サーバーはVirtual Boxで動作しています。私はパテを介してサーバーにアクセスしています。

私は数日間このことに立ち往生していました。私は、このサイトやその他の他の質問で見つけることができるすべてのソリューションを試した後、今何をすべきかについて完全な犠牲を払っています。この質問に答えるのに必要なすべての情報/ログを提供することができます。

この問題については、本当にありがとうございます。

答えて

1

問題を修正しました。 error.logには、無視していたキーバッファサイズに関する行がありました。

#myisam-recover = BACKUP 
#key_buffer = 16M 

私はデフォルトのデータディレクトリを削除し、データディレクトリを再初期化しました。 Mysqlは問題なく起動しました。

関連する問題