I have an amazon ec2 instance running on the Amazon Linux AMI and its a micro instance. I wanted to install Django onto my server so I entered these commands
wget http://www.mlsite.net/blog/wp-content/uploads/2008/11/go
wget http://www.mlsite.net/blog/wp-content/uploads/2008/11/django.conf
chmod 744 go
./go
So after I was done, I ran sudo service httpd restart and sudo service mysqld restart
and This is what came up for mysqld:
Stopping mysqld: [ OK ]
MySQL Daemon failed to start.
Starting mysqld: [FAILED]
So I deleted the django files /usr/local/python2.6.8/site-packages/django_registration.egg
and I tried finding the error and I found out that in my
/etc/my.cnf for the socket, it said
[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
datadir=/mnt/ebs/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[mysqld]
default-storage-engine=INNODB
[mysqld]
default-storage-engine=INNODB
[mysqld]
default-storage-engine=INNODB
[mysqld]
default-storage-engine=INNODB
so I went to /var/lock/subsys/ and there was no mysql.sock. I tried creating one using vim but it still didn’t work. Then I checked the error log and it said
120712 20:33:11 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
120712 20:33:15 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
UPDATE:
I entered these commands:
cd /var/lib/mysql/
touch mysql.sock
chmod +x mysql.sock
chown mysql:mysql -R *
And it still didn’t work…
So I am pretty much lost right now. I know it has something to do with mysql.sock
If you might know a reason why this was caused could you please let me know? I have a wordpress site on my server, so i kind of need MySQL to work. Thanks!
Inspecting the
goscript you downloaded and executed, I found the following lines:This effectively changes your mysql data directory (
datadirsetting), so you can’t access any previously created database (like the wordpress database).As a wild guess, I would think that the mysqld can’t access
/mnt/ebs/mysqland therefore doesn’t start. Try to change it back to/var/lib/mysql. However, this might interfere with your django. If you get the django configured mysql to run, you can always add a second my.cnf with another name and other tcp port and run two MySQL servers with different configurations.The socket error message is about the MySQL server not running. Do not try to emulate the socket by putting a file in its way.
The
goscript also makes some more changes to my.cnf that could be a problem. Have a look at the go file yourself and try to undo the changes made.If nothing of the above helps, you can try to start the mysqld process from command line by hand, using the same arguments as the service script does, plus an added
--verboseand post its output.