Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I installed Red Hat 7.3 then installed Apache with PHP and finally installed the rpm for Mysql. It is suposably starting on boot and if I try to start it again it informs me something is already running on that port. When I try to run phpMyAdmin it tells me it can't connect on socket /tmp/mysql.sock (Note: I have tried other scripts that use mysql plus I have gotten phpMyAdmin to work on Weeendowz.) I thought that maybe my firewall was blocking access to the port (3306 if I am not mistaken) so next time I installed Red Hat I enabled I added 3306:tcp to the permitted ports/protocols but no success, I am still having the same problem. I searched for a fix but was unable to find one. I would appreciate any tips or links.
one was is to use a text editor and create a blank file and save it to /tmp/mysql.sock
another way is to use the touch comand,
shell prompt$> touch /tmp/mysql.sock
with both of these methods you will need write permision to the tmp directory.
After the file is created you should change the owner an group of the file to mysql.
this will change owner and group
shell prompt$> chown mysql.mysql /tmp/mysql.sock
then you need to change permision
shell prompt$> chmod 7774 /tmp/mysql.sock
this sets the userid then gives owner and qroup read, write and execute permisions and gives everyone else read permision. I don't think you need to give everyone else the write and execute permisions.
It doesn't matter that the file is empty Mysql uses it like a pipe and never leaves anything in it anyways.
You may need to do this as root user to set the userid.
After all of this is said this still may not resolve the true problem. When the MySql Daemon is started it should create this file for you before it starts the actual server.
how do u start the server. it might be the wrong command.
cause usually u can't go wrong installing rpms.
i build mysql from source an start it
./bin/safe_msqld --user root &
this should be working on your box too
maybe it cant create the sock connection cause you don't have permissions for that. but as i said before rpms are pretty safe
good luck
jens
I installed a binary distrobution and it is supposed to start when my computer starts. If I try to start it again it sais something is already running on that port.
Just creating the file /tmp/mysql.sock will not work.
Because it is a socket. Not a TCP or UDB networking socket, but a UNIX filesystem socket. Since it's not connected to a network, only processes (like PHP, or the mysql-client) on the same computer can connect to it. This makes it more secure.
MySQL should create it by itself when it starts, and listen on the socket to talk through it to its clients.
Such a socket should be visible though using "ls /tmp", so if it is not there, the MySQL daemon didn't create it. There must be something else wrong.
Maybe PHP doesn't have the file-system rights to read/write to it.
Did you try connecting to the database with a 'normal' mysql client?
Sorry about the mysql.sock file. I could have sworn I read that some where in this forum.
Have you done a
command prompt$> ps -ax | more
you should see some where in that list of processes the line
/bin/sh ./bin/mysql_safe --user=mysql
if you see this then you need to check your my.cnf file. You can find it /etc/my.cnf
if it is not there the do a find command
command prompt&> find / -name my.cnf
if this command does not give you a result then this file needs to be made . This file defines the the mysql.sock as a socket file and is how it is created when mysqld is started.
below is a copy of what I have for my modest system
# Example mysql config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# a important part and systems up to 128M very MySQL is used together with
# other programs (like a web server)
#
# You can copy this file to
# /etc/mf.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /usr/local/mysql/var) or
# ~/.my.cnf to set user-specific options.
#
# One can in this file use all long options that the program supports.
# If you want to know which options a program support, run the program
# with --help option.
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
set-variable = key_buffer=16M
set-variable = max_allowed_packet=1M
set-variable = table_cache=64
set-variable = sort_buffer=512K
set-variable = net_buffer_length=8K
set-variable = myisam_sort_buffer_size=8M
log-bin
server-id = 1
safe-show-database
# Point the following paths to different dedicated disks
#tmpdir = /tmp/
#log-update = /path-to-dedicated-directory/hostname
# Uncomment the following if you are using BDB tables
#set-variable = bdb_cache_size=4M
#set-variable = bdb_max_lock=10000
# Uncomment the following if you are using Innobase tables
#innodb_data_file_path = ibdata1:400M
#innodb_data_home_dir = /usr/local/mysql/var/
#innodb_log_group_home_dir = /usr/local/mysql/var/
#innodb_log_arch_dir = /usr/local/mysql/var/
#set-variable = innodb_mirrored_log_groups=1
#set-variable = innodb_log_files_in_group=3
#set-variable = innodb_log_file_size=5M
#set-variable = innodb_log_buffer_size=8M
#innodb_flush_log_at_trx_commit=1
#innodb_log_archive=0
#set-variable = innodb_buffer_pool_size=16M
#set-variable = innodb_additional_mem_pool_size=2M
#set-variable = innodb_file_io_threads=4
#set-variable = innodb_lock_wait_timeout=50
make sure that you use your path to the location of your Mysql after the cd in the command above. Also depending on what version you have of Mysql determines how you start your daemon.
for example I have mysql 4.0 I need to start it like this
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.