【问题标题】:Missing mysql.sock file. phpMyAdmin - Fedora 17缺少 mysql.sock 文件。 phpMyAdmin - Fedora 17
【发布时间】:2012-07-30 19:22:38
【问题描述】:

我使用“Webadmin”运行 Fedora 17。所以我尝试使用 webadmin 选项来更新上传到我的 MySQL 数据库的最大大小。现在,我无法重新启动 mysqld。我没有 GUI,所以当运行 systemctl status mysqld.service 时,我给了我这个消息:

[root@localhost ~]# 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时,我找不到这个文件。

请帮忙。

【问题讨论】:

  • 您可以尝试“getenforce”查看天气“SELinux”是否已启用。如果可能会导致意想不到的问题。如果已启用,请尝试“setenforce 0”禁用它。欲了解更多信息,请点击此URL

标签: mysql linux phpmyadmin fedora webmin


【解决方案1】:

在打了我的显示器并踢了我的服务器后,我找到了解决办法。不知道安全或擅长的程度,但它对我有用。

在终端打开你的 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

欢迎任何 cmets 或建议。 谢谢。

【讨论】:

    猜你喜欢
    • 2018-05-22
    • 2011-08-05
    • 2013-09-02
    • 2014-07-28
    • 2011-06-22
    • 2011-08-12
    • 2013-10-19
    • 2016-09-30
    • 2019-11-16
    相关资源
    最近更新 更多