2012-07-30 57 views
0

我用「Webadmin」運行Fedora 17。所以我試圖使用webadmin選項來更新上傳最大大小到我的MySQL數據庫。現在,我無法重新啓動mysqld。我沒有GUI,因此運行systemctl status mysqld.service當我給我這個消息:缺少mysql.sock文件。 phpMyAdmin - Fedora 17

[[email protected] ~]# systemctl status mysqld.service 
mysqld.service - MySQL database server 
      Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled) 
      Active: failed (Result: exit-code) since Mon, 30 Jul 2012 15:08:26 -0400; 6min ago 
     Process: 3560 ExecStartPost=/usr/libexec/mysqld-wait-ready $MAINPID (code=exited, status=1/FAILURE) 
     Process: 3559 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS) 
     Process: 3542 ExecStartPre=/usr/libexec/mysqld-prepare-db-dir (code=exited, status=0/SUCCESS) 
      CGroup: name=systemd:/system/mysqld.service 

Jul 30 15:08:23 localhost mysqld_safe[3559]: 120730 15:08:23 mysqld_safe Logging to '/var/log/mysqld.log'. 
Jul 30 15:08:23 localhost mysqld_safe[3559]: 120730 15:08:23 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 

或當我嘗試訪問我的phpmyadmin屏幕,我看到這條消息:

phpMyAdmin - Error 
#2002 - Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 
The server is not responding (or the local server's socket is not correctly configured). 

當我在終端locate mysql.sock運行顯示正確的路徑/var/lib/mysql/mysql.sock。 但是,當我運行這個命令ls /var/lib/mysql,我無法找到這個文件。

請幫忙。

+0

您可以嘗試「getenforce」查看天氣「SELinux」已啓用。如果可能會導致意外的問題 如果啓用,請嘗試「setenforce 0」以禁用它。欲瞭解更多信息,請點擊[URL](http://www.linuxforums.org/forum/red-hat-fedora-linux/187866-mysql-not-starting-fedora-16-a.html) – zczhuohuo 2013-05-29 06:22:13

回答

0

在衝我的顯示器並踢我的服務器後,我能找到一個修復程序。不知道它有多安全或優秀,但它對我有用。

在終端打開你的my.cnf文件# nano /etc/my.cnf

刪除或只是發表評論用「#」的所有現有設置,然後只需粘貼代碼,我就發現http://blog.mclaughlinsoftware.com/2011/12/07/fixing-my-cnf-on-fedora/

[mysqld] 
# Settings user and group are ignored when systemd is used. 
# If you need to run mysqld under different user or group, 
# customize your systemd unit file for mysqld according to the 
# instructions in http://fedoraproject.org/wiki/Systemd 

# Default directory. 
datadir=/var/lib/mysql 

# The TCP/IP Port the MySQL Server listens on. 
port=3306 

# The Linux Socket the MySQL Server uses when not using a listener. 
# socket=/var/lib/mysql/mysql.sock 

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

# The default storage engine that will be used when creating new tables. 
default-storage-engine=INNODB 

# Set the SQL mode to strict. 
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" 

# Set the maximum number of connections. 
max_connections=100 

# Set the number of open tables for all threads. 
table_cache=256 

# Set the maximum size for internal (in-memory) temporary tables. 
tmp_table_size=26M 

# Set how many threads should be kept in a cache for reuse. 
thread_cache_size=8 

# MyISAM configuration. 
myisam_max_sort_file_size=100G 
myisam_sort_buffer_size=52M 
key_buffer_size=36M 
read_rnd_buffer_size=256K 
sort_buffer_size=256K 

# InnoDB configuration. 
innodb_data_home_dir=/var/lib/mysql 
innodb_additional_mem_pool_size=2M 
innodb_flush_log_at_trx_commit=1 
innodb_log_buffer_size=1M 
innodb_buffer_pool_size=25M 
innodb_log_file_size=5M 
innodb_thread_concurrency=8 

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

打開任何意見或建議。 謝謝。