mysql - 缺少 mysql.sock 文件。 phpMyAdmin-Fedora 17

标签 mysql linux phpmyadmin fedora webmin

我使用“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 时,我找不到这个文件。

请帮忙。

最佳答案

在敲打我的显示器并踢掉我的服务器后,我找到了修复方法。不确定有多安全或多擅长,但它对我有用。

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

欢迎任何意见或建议。 谢谢。

关于mysql - 缺少 mysql.sock 文件。 phpMyAdmin-Fedora 17,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11728176/

相关文章:

mysql - 建立数据库连接的 WordPress 错误 (xampp)

mysql - 如何通过 http 从 arduino yun 发送传感器数据以与 Web api 交互

javascript - 为什么在 JavaScript 中,MySql 时间戳在移动设备上的转换方式与在桌面设备上的转换方式不同?

mysql - phpMyAdmin 无法正确显示或插入 Unicode 字符到数据库中

MySQL-使用游标删除存储过程

c++ - 为每个连接手动分配端口号

linux - 带有 clang++ 和 libc++ 的 linux 上的 std::cerr 导致 SIGABRT

docker - docker-compose phpmyadmin启动

php - MySQL-添加商店在休息后每天营业两次的营业时间

linux - 在 Ubuntu 13.04 上安装 Postgresql 9.2 时出现问题