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

时间:2012-07-30 19:22:39

标签: 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时,我无法找到此文件。

请帮忙。

1 个答案:

答案 0 :(得分: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

打开任何评论或建议。 谢谢。