Why can't I start my gunicorn server? "Connection in use" - gunicorn

Any ideas why my gunicorn server won't start?
jeffy#originaldjangster:~$ sudo /home/jeffy/django_files/django_test_venv/bin/gunicorn -c /home/jeffy/django_files/django_test_venv/gunicorn_config.py django_test.wsgi
Connection in use: ('127.0.0.1', 8001)
Retrying in 1 second.
Connection in use: ('127.0.0.1', 8001)
Retrying in 1 second.
Connection in use: ('127.0.0.1', 8001)
Retrying in 1 second.
Connection in use: ('127.0.0.1', 8001)
Retrying in 1 second.
Connection in use: ('127.0.0.1', 8001)
Retrying in 1 second.
Can't connect to ('127.0.0.1', 8001)
jeffy#originaldjangster:~$
nginx listens to http://104.131.200.120/, and passes to gunicorn, which listens to 127.0.0.1. I'm on Ubuntu 14.
I've listed all processes to see if gunicorn was already running:
jeffy#originaldjangster:~$ ps -a
PID TTY TIME CMD
7653 pts/1 00:00:00 ps
jeffy#originaldjangster:~$ ps
PID TTY TIME CMD
7249 pts/1 00:00:00 bash
7654 pts/1 00:00:00 ps
jeffy#originaldjangster:~$ ps -A
PID TTY TIME CMD
1 ? 00:00:02 init
2 ? 00:00:00 kthreadd
3 ? 00:00:00 ksoftirqd/0
5 ? 00:00:00 kworker/0:0H
6 ? 00:00:00 kworker/u2:0
7 ? 00:00:00 rcu_sched
8 ? 00:00:00 rcu_bh
9 ? 00:00:00 migration/0
10 ? 00:00:00 watchdog/0
11 ? 00:00:00 khelper
12 ? 00:00:00 kdevtmpfs
13 ? 00:00:00 netns
14 ? 00:00:00 writeback
15 ? 00:00:00 kintegrityd
16 ? 00:00:00 bioset
17 ? 00:00:00 kworker/u3:0
18 ? 00:00:00 kblockd
19 ? 00:00:00 ata_sff
20 ? 00:00:00 khubd
21 ? 00:00:00 md
22 ? 00:00:00 devfreq_wq
23 ? 00:00:08 kworker/0:1
24 ? 00:00:00 khungtaskd
25 ? 00:00:00 kswapd0
26 ? 00:00:00 ksmd
27 ? 00:00:00 fsnotify_mark
28 ? 00:00:00 ecryptfs-kthrea
29 ? 00:00:00 crypto
41 ? 00:00:00 kthrotld
44 ? 00:00:00 scsi_eh_0
45 ? 00:00:00 scsi_eh_1
66 ? 00:00:00 deferwq
67 ? 00:00:00 charger_manager
120 ? 00:00:01 jbd2/vda-8
121 ? 00:00:00 ext4-rsv-conver
271 ? 00:00:00 upstart-udev-br
275 ? 00:00:00 systemd-udevd
322 ? 00:00:00 dbus-daemon
349 ? 00:00:00 kpsmoused
351 ? 00:00:00 kworker/0:2
356 ? 00:00:00 systemd-logind
358 ? 00:00:00 rsyslogd
387 ? 00:00:00 kvm-irqfd-clean
624 ? 00:00:00 upstart-file-br
704 ? 00:00:00 upstart-socket-
758 tty4 00:00:00 getty
761 tty5 00:00:00 getty
767 tty2 00:00:00 getty
768 tty3 00:00:00 getty
770 tty6 00:00:00 getty
794 ? 00:00:00 sshd
800 ? 00:00:00 acpid
802 ? 00:00:00 cron
804 ? 00:00:00 atd
853 ? 00:00:01 postgres
855 ? 00:00:00 postgres
856 ? 00:00:01 postgres
857 ? 00:00:01 postgres
858 ? 00:00:02 postgres
859 ? 00:00:02 postgres
903 ? 00:00:17 supervisord
961 tty1 00:00:00 getty
982 ? 00:00:00 kauditd
1266 ? 00:00:07 kworker/u2:1
3027 ? 00:00:00 kworker/u3:1
3230 ? 00:00:00 sudo
3231 ? 00:00:01 gunicorn
7014 ? 00:00:00 gunicorn
7115 ? 00:00:00 sshd
7192 ? 00:00:00 sshd
7193 ? 00:00:00 sftp-server
7200 ? 00:00:00 sshd
7248 ? 00:00:00 sshd
7249 pts/1 00:00:00 bash
7610 ? 00:00:00 nginx
7613 ? 00:00:00 nginx
7614 ? 00:00:00 nginx
7615 ? 00:00:00 nginx
7616 ? 00:00:00 nginx
7649 ? 00:00:00 sshd
7650 ? 00:00:00 sshd
7655 pts/1 00:00:00 ps
Here's the two gunicorn lines:
3231 ? 00:00:01 gunicorn
7014 ? 00:00:00 gunicorn
I've tried to kill those two processes, but when bringing them to the foreground with fg 3231, for example, it says "no such job".
Someone suggested I try netstat -aWn --programs | grep 80. Here is the result, which I don't understand
jeffy#originaldjangster:~$ sudo netstat -aWn --programs | grep 80
tcp 0 0 127.0.0.1:8001 0.0.0.0:* LISTEN 3231/python3.4
unix 2 [ ACC ] STREAM LISTENING 8911 800/acpid /var/run/acpid.socket
unix 2 [ ] DGRAM 8908 800/acpid
Any ideas what is causing this "connection in use" error? Thanks.

Turns out I just needed to sudo kill 3231 and sudo kill 7014. I incorrectly thought they first needed to brought to the foreground. The fact that the processes couldn't be seen until I used the capital A option (ps -A) mislead me, that they were somehow special.
The server was running (in the foreground) when I went to sleep before my wife. She turned off the computer before going to bed.
Ubuntu and gunicorn Newbie. Could you tell?

I have gotten used to run killall gunicorn before (re)starting Gunicorn in my local development environment.

For anyone who has nothing running on the port to kill, if app.run() is in the file gunicorn is running, then it will run twice on the port and keep attempting to retry the connection.
In my case, I was running $ gunicorn run:app where run.py had:
from app import app
app.run(debug=True)
in it. When I commented out the app.run, it worked.

I've found my solution here.
ps ax|grep gunicorn
>>> 932 pts/0 S 0:01 /home/someuser/flaskdir/.venv/bin/python3 /home/someuser/flaskdir/.venv/bin/gunicorn -w 3 flaskapp:app
kill -9 932

Restarting the computer helped for me
I did not have gunicorn in listing of ps -A so I did not know what to kill
I also did not get anything obvious from netstat -aWn --programs | grep 80

This worked for me:
sudo fuser -k 8000/tcp

I also came across same problem ...
Dont try to run gunicorn from su .
Just change user and try again

Related

An uncertain issue about CPU cache or GC or any else

I'm writing a arbitrary JSON parser for golang, the project nearly finished. But I found a confusing problem about the performance:
I want to test the performance about parse a big(100Mb) JSON string, I use the test file itself to init the JSON struct in memory and write the marshaled JSON string to a file, and then read from it, if the file exists already, will not init it in memory, just read from file directly. The performance is totally different: cost about double time to parse when read from file directly. At the same time, I'm testing the performance about parse normal(1Kb) JSON string and deep(2Mb) JSON string, both of these are almost unaffected.
Why? is CPU cache? or GC? or any else?
The code at https://github.com/acrazing/cheapjson, and I opened a issue about this problem at https://github.com/acrazing/cheapjson/issues/1. You can get more detailed information about the benchmark from here.
I am unable to reproduce your issue: https://github.com/acrazing/cheapjson/issues/1. My benchmark results:
$ go version
go version devel +b817359 Sat Jul 22 01:29:58 2017 +0000 linux/amd64
$ rm -rf data
$ ls -la data
ls: cannot access 'data': No such file or directory
$ go test -v -run=! -bench=. -benchmem parser_test.go
2017/07/23 02:42:09 big input size: 117265882, normal input size: 763, deep input size: 2134832
goos: linux
goarch: amd64
BenchmarkUnmarshalBigInput-4 1 1107362634 ns/op 278192256 B/op 8280859 allocs/op
BenchmarkSimpleJsonBigInput-4 1 2680878194 ns/op 569595680 B/op 7575252 allocs/op
BenchmarkUnmarshalNormalInput-4 300000 5685 ns/op 4622 B/op 129 allocs/op
BenchmarkSimpleJsonNormalInput-4 200000 9565 ns/op 5602 B/op 87 allocs/op
BenchmarkUnmarshalDeepInput-4 1000 2085186 ns/op 372922 B/op 5134 allocs/op
BenchmarkSimpleJsonDeepInput-4 100 12311435 ns/op 8911102 B/op 6117 allocs/op
PASS
ok command-line-arguments 15.067s
$ ls -la datatotal 116620
drwxr-xr-x 2 peter peter 4096 Jul 23 02:42 .
drwxr-xr-x 5 peter peter 4096 Jul 23 02:42 ..
-rwxr-xr-x 1 peter peter 117265882 Jul 23 02:42 big.json
-rwxr-xr-x 1 peter peter 2134832 Jul 23 02:42 deep.json
-rwxr-xr-x 1 peter peter 763 Jul 23 02:42 normal.json
$ go test -v -run=! -bench=. -benchmem parser_test.go
2017/07/23 02:42:31 big input size: 117265882, normal input size: 763, deep input size: 2134832
goos: linux
goarch: amd64
BenchmarkUnmarshalBigInput-4 1 1140498937 ns/op 278220704 B/op 8280995 allocs/op
BenchmarkSimpleJsonBigInput-4 1 2685285322 ns/op 569592608 B/op 7575242 allocs/op
BenchmarkUnmarshalNormalInput-4 300000 5685 ns/op 4622 B/op 129 allocs/op
BenchmarkSimpleJsonNormalInput-4 200000 9633 ns/op 5601 B/op 87 allocs/op
BenchmarkUnmarshalDeepInput-4 1000 2086891 ns/op 372927 B/op 5134 allocs/op
BenchmarkSimpleJsonDeepInput-4 100 12387413 ns/op 8911084 B/op 6117 allocs/op
PASS
ok command-line-arguments 11.903s
$ ls -la data
total 116624
drwxr-xr-x 2 peter peter 4096 Jul 23 02:42 .
drwxr-xr-x 5 peter peter 4096 Jul 23 02:42 ..
-rwxr-xr-x 1 peter peter 117265882 Jul 23 02:42 big.json
-rwxr-xr-x 1 peter peter 2134832 Jul 23 02:42 deep.json
-rwxr-xr-x 1 peter peter 763 Jul 23 02:42 normal.json
$
I got similar results on four different machines and two Operating systems: three Linux and one Windows.
This is the old benchmark result, time is at 11:01
This is the final test result currently, the result could not reproduce, it's amazing.

Cannot see MySQL tables after moving database dir with symbolic link

I'm running out of space on the partition where MySQL is installed so I tried moving my largest database to a new partition and symlinked this in the data directory. When I try to use this database I get the following error
mysql> use fb20;
Database changed
mysql> show tables;
ERROR 1018 (HY000): Can't read dir of './fb20/' (errno: 13)
I've checked that symlinks are enabled:
mysql> show variables like 'have_symlink';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| have_symlink | YES |
+---------------+-------+
All of the permissions look correct. The MySQL data directory is /data:
root> ll /data/
drwxr-x--- 243 mysql mysql 8192 Feb 21 08:02 mysql/
root> ll /data/mysql/ | grep fb20
lrwxrwxrwx 1 mysql mysql 19 Feb 21 08:02 fb20 -> /sandata/mysql/fb20/
and the new directory is /sandata:
root> ll /sandata/
drwxr-x--- 3 mysql mysql 60 Feb 20 20:32 mysql/
root> ll /sandata/mysql/
total 360
drwxr-x--- 3 mysql mysql 60 Feb 20 20:32 ./
drwxrwxr-x 35 root perma 4096 Feb 20 19:59 ../
drwx------ 2 mysql mysql 303104 Feb 15 12:20 fb20/
Not sure what I am doing wrong.
Based on the comment I added the following lines to the file /etc/apparmor.d/usr.sbin.mysqld
/sandata/mysql/ r,
/sandata/mysql/** rwk,
and then reloaded the profile (restarting apparmor did not work):
sudo apparmor_parser -r /etc/apparmor.d/usr.sbin.mysqld

Can't start mysql and my.cnf is missing

For some reason, I can't start MySql.
$ sudo /etc/init.d/mysql start
[sudo] password for abigail:
Starting MySQL.............................................[FAILED]................................................................................
What caused this?
This is what in my /var/lib/mysql
$ ll -h /var/lib/mysql
total 1005M
-rw-rw----. 1 mysql mysql 16K Mar 28 11:08 aria_log.00000001
-rw-rw----. 1 mysql mysql 52 Mar 28 11:08 aria_log_control
-rw-rw----. 1 mysql mysql 908M Mar 31 20:10 ibdata1
-rw-rw----. 1 mysql mysql 48M Mar 31 20:09 ib_logfile0
-rw-rw----. 1 mysql mysql 48M Mar 31 20:10 ib_logfile1
-rw-rw----. 1 mysql mysql 5 Mar 28 11:09 localhost.pid
-rw-rw----. 1 mysql mysql 0 Oct 29 23:04 multi-master.info
drwx--x--x. 2 mysql mysql 4.0K Oct 29 23:01 mysql
drwx------. 2 mysql mysql 19 Oct 29 23:01 performance_schema
-rw-rw----. 1 mysql mysql 24K Mar 28 11:09 tc.log
drwx------. 2 mysql mysql 4.0K Nov 3 22:10 test
I think I might have to reinstall mysql.
my.cnf is supposed to be in /etc/my.cnf.
Check the start log for the error message, like in /var/log/mysqld.log.

why my MySQL binary log file size is so small?

I have a lot of small binary log files , each of them just only 126 Bytes
-rw-rw----. 1 mysql mysql 126 Jan 6 16:13 mysql-bin.000001
-rw-rw----. 1 mysql mysql 126 Jan 6 16:16 mysql-bin.000002
-rw-rw----. 1 mysql mysql 150 Jan 7 10:34 mysql-bin.000003
-rw-rw----. 1 mysql mysql 126 Jan 8 09:57 mysql-bin.000004
-rw-rw----. 1 mysql mysql 126 Jan 8 11:08 mysql-bin.000005
-rw-rw----. 1 mysql mysql 107 Jan 8 11:09 mysql-bin.000006
-rw-rw----. 1 mysql mysql 126 Jan 8 13:21 mysql-bin.000007
-rw-rw----. 1 mysql mysql 342 Jan 8 16:25 mysql-bin.index
how to let them grow bigger? and my "binlog_cache_size" is more than 126 Byte
mysql> show variables like 'binlog_cache_size';
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1
Current database: test
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| binlog_cache_size | 32768 |
+-------------------+-------+
1 row in set (0.00 sec)
can anybody tell me why(⊙ˍ⊙) ? thank you very much :)

No longer able to connect to MySQL through socket

I was trying to do replication and setup my server as slave. i first changed permissions using
sudo chmod 777 /etc/mysql/my.cnf
then
sudo chown user:user -R /etc/mysql
then i tried installing notepad and it crashed. restarted the server and installed Jedit. Finally I edited the my.cnf file added
server-id=1359126008
under [mysqld]
after a restart of mysql and then of the server i got this error
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
now I am not able to connect any longer. Also the mysqld.sock file does not exist in that folder.
UPDATE
user#ubuntu:~$ sudo service mysql start
start: Job failed to start
user#ubuntu:~$ sudo service mysql stop
stop: Unknown instance:
user#ubuntu:~$ sudo service mysql status
mysql stop/waiting
UPDATE 2
location from my.cnf: log_error = /var/log/mysql/error.log
all existing lines in log:
130125 10:38:09 [Note] /usr/sbin/mysqld: Normal shutdown
130125 10:38:09 [Note] Event Scheduler: Purging the queue. 2 events
130125 10:38:09 InnoDB: Starting shutdown...
130125 10:38:11 InnoDB: Shutdown completed; log sequence number 7759014
130125 10:38:11 [Note] /usr/sbin/mysqld: Shutdown complete
UPDATE 3
nothing related to mysql is running.
user#ubuntu:~$ ps -A
PID TTY TIME CMD
1 ? 00:00:00 init
2 ? 00:00:00 kthreadd
3 ? 00:00:00 ksoftirqd/0
6 ? 00:00:00 migration/0
7 ? 00:00:00 watchdog/0
8 ? 00:00:00 migration/1
10 ? 00:00:00 ksoftirqd/1
11 ? 00:00:00 watchdog/1
12 ? 00:00:00 migration/2
14 ? 00:00:00 ksoftirqd/2
15 ? 00:00:00 watchdog/2
16 ? 00:00:00 migration/3
18 ? 00:00:00 ksoftirqd/3
19 ? 00:00:00 watchdog/3
20 ? 00:00:00 cpuset
21 ? 00:00:00 khelper
22 ? 00:00:00 kdevtmpfs
23 ? 00:00:00 netns
24 ? 00:00:00 kworker/u:1
25 ? 00:00:00 sync_supers
26 ? 00:00:00 bdi-default
27 ? 00:00:00 kintegrityd
28 ? 00:00:00 kblockd
29 ? 00:00:00 ata_sff
30 ? 00:00:00 khubd
31 ? 00:00:00 md
32 ? 00:00:00 kworker/0:1
35 ? 00:00:00 kworker/3:1
36 ? 00:00:00 khungtaskd
37 ? 00:00:00 kswapd0
38 ? 00:00:00 ksmd
39 ? 00:00:00 khugepaged
40 ? 00:00:00 fsnotify_mark
41 ? 00:00:00 ecryptfs-kthrea
42 ? 00:00:00 crypto
51 ? 00:00:00 kthrotld
52 ? 00:00:00 scsi_eh_0
53 ? 00:00:00 scsi_eh_1
54 ? 00:00:00 kworker/u:2
56 ? 00:00:00 binder
75 ? 00:00:00 deferwq
76 ? 00:00:00 charger_manager
77 ? 00:00:00 devfreq_wq
123 ? 00:00:01 kworker/3:2
182 ? 00:00:00 scsi_eh_2
227 ? 00:00:00 kdmflush
229 ? 00:00:00 kdmflush
249 ? 00:00:00 jbd2/dm-0-8
250 ? 00:00:00 ext4-dio-unwrit
259 ? 00:00:00 scsi_eh_3
260 ? 00:00:00 usb-storage
261 ? 00:00:00 scsi_eh_4
262 ? 00:00:00 usb-storage
277 ? 00:00:00 flush-252:0
353 ? 00:00:00 upstart-udev-br
355 ? 00:00:00 udevd
453 ? 00:00:00 edac-poller
487 ? 00:00:00 ttm_swap
514 ? 00:00:00 kpsmoused
535 ? 00:00:00 dbus-daemon
541 ? 00:00:00 rsyslogd
550 ? 00:00:00 bluetoothd
581 ? 00:00:00 krfcommd
592 ? 00:00:00 avahi-daemon
600 ? 00:00:00 avahi-daemon
619 ? 00:00:00 cupsd
696 ? 00:00:00 kvm-irqfd-clean
699 ? 00:00:01 kworker/2:3
701 ? 00:00:00 kworker/0:3
799 ? 00:00:00 upstart-socket-
957 ? 00:00:00 dhclient
1024 ? 00:00:00 winbindd
1035 ? 00:00:00 modem-manager
1040 ? 00:00:00 winbindd
1047 ? 00:00:00 NetworkManager
1058 ? 00:00:00 polkitd
1098 ? 00:00:00 udevd
1099 ? 00:00:00 udevd
1125 tty4 00:00:00 getty
1133 tty5 00:00:00 getty
1139 tty2 00:00:00 getty
1140 tty3 00:00:00 getty
1144 tty6 00:00:00 getty
1158 ? 00:00:00 acpid
1168 ? 00:00:00 atd
1169 ? 00:00:00 cron
1174 ? 00:00:00 lightdm
1175 ? 00:00:00 whoopsie
1177 ? 00:00:00 irqbalance
1237 tty7 00:04:31 Xorg
1437 tty1 00:00:00 getty
1445 ? 00:00:00 accounts-daemon
1463 ? 00:00:00 console-kit-dae
1584 ? 00:00:00 upowerd
1676 ? 00:00:00 lightdm
1757 ? 00:00:00 colord
1844 ? 00:00:00 rtkit-daemon
1960 ? 00:00:00 gnome-keyring-d
1971 ? 00:00:00 gnome-session
2006 ? 00:00:00 ssh-agent
2009 ? 00:00:00 dbus-launch
2010 ? 00:00:01 dbus-daemon
2012 ? 00:00:00 at-spi-bus-laun
2016 ? 00:00:00 dbus-daemon
2019 ? 00:00:00 at-spi2-registr
2033 ? 00:00:01 gnome-settings-
2038 ? 00:00:00 gvfsd
2042 ? 00:00:00 gvfsd-fuse
2062 ? 00:00:00 pulseaudio
2063 ? 00:00:00 gconf-helper
2065 ? 00:00:00 gconfd-2
2067 ? 00:00:00 dconf-service
2068 ? 00:00:29 nautilus
2072 ? 00:00:00 polkit-gnome-au
2073 ? 00:00:00 bluetooth-apple
2076 ? 00:00:00 nm-applet
2078 ? 00:00:00 gnome-fallback-
2090 ? 00:00:00 gvfs-udisks2-vo
2094 ? 00:00:00 udisksd
2109 ? 00:00:08 dropbox
2115 ? 00:00:00 gvfs-afc-volume
2122 ? 00:00:00 gvfs-gphoto2-vo
2133 ? 00:00:00 gvfsd-trash
2146 ? 00:00:00 gvfsd-burn
2163 ? 00:00:01 bamfdaemon
2178 ? 00:00:00 notify-osd
2206 ? 00:00:00 sh
2207 ? 00:00:01 gtk-window-deco
2218 ? 00:06:56 compiz
2247 ? 00:00:09 unity-panel-ser
2249 ? 00:00:06 hud-service
2260 ? 00:00:00 indicator-sound
2262 ? 00:00:00 indicator-sessi
2268 ? 00:00:00 indicator-print
2273 ? 00:00:00 indicator-datet
2275 ? 00:00:00 indicator-appli
2277 ? 00:00:00 indicator-messa
2304 ? 00:00:00 evolution-sourc
2313 ? 00:00:00 goa-daemon
2317 ? 00:00:00 geoclue-master
2330 ? 00:00:00 ubuntu-geoip-pr
2335 ? 00:00:00 telepathy-indic
2341 ? 00:00:00 mission-control
2348 ? 00:00:00 signon-ui
2351 ? 00:00:00 zeitgeist-datah
2357 ? 00:00:00 zeitgeist-daemo
2363 ? 00:00:00 zeitgeist-fts
2371 ? 00:00:00 cat
2375 ? 00:00:07 firefox
2403 ? 00:00:00 unity-webapps-s
2421 ? 00:00:00 unity-applicati
2423 ? 00:00:00 unity-files-dae
2425 ? 00:00:00 unity-gwibber-d
2427 ? 00:00:00 unity-music-dae
2429 ? 00:00:00 unity-lens-phot
2431 ? 00:00:00 unity-shopping-
2433 ? 00:00:00 unity-lens-vide
2514 ? 00:00:00 unity-musicstor
2515 ? 00:00:00 unity-scope-gdo
2543 ? 00:00:00 unity-scope-vid
2573 ? 00:00:00 teamviewer
2578 ? 00:00:00 wrapper
2604 ? 00:00:38 TeamViewer.exe
2607 ? 00:00:47 wineserver
2611 ? 00:00:00 services.exe
2632 ? 00:00:00 update-notifier
2643 ? 00:00:00 system-service-
2654 ? 00:06:38 TeamViewer_Desk
2679 ? 00:00:00 deja-dup-monito
2700 ? 00:00:00 gvfsd-metadata
2825 ? 00:00:03 gnome-terminal
2834 ? 00:00:00 gnome-pty-helpe
2835 pts/0 00:00:00 bash
3629 ? 00:00:00 apache2
3636 ? 00:00:00 apache2
3637 ? 00:00:00 apache2
3638 ? 00:00:00 apache2
3639 ? 00:00:00 apache2
3640 ? 00:00:00 apache2
3641 ? 00:00:00 apache2
3644 ? 00:00:00 apache2
3645 ? 00:00:00 apache2
3646 ? 00:00:00 apache2
3647 ? 00:00:00 apache2
4089 ? 00:00:00 kworker/2:0
4419 ? 00:00:08 java
4465 ? 00:00:00 kworker/1:0
4486 ? 00:00:00 kworker/1:2
4552 ? 00:00:00 kworker/2:1
4762 pts/0 00:00:00 ps
UPDATE 4
I couldn't get it working. Re-installed mysql and now its working. If you are worried about the databases, mysql gave me the option of removing them or keeping them. I kept them, installed mysql, used the same root pass as before and now everything is working!! thanks guys!
What worries me is the
sudo chown user:user -R /etc/mysql
I do not trust any other user but the mysql user to handle the MySQL Instance
Since mysql is down, do the following:
sudo chown mysql:mysql -R /etc/mysql
service mysql start
Give it a Try !!!