Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Hello everybody please ignore my noobness,

My problem start from connecting to mysql on ubuntu 12.04

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

and after debugging and googling i found following in error.log,

130714 11:23:45 [Note] Plugin 'FEDERATED' is disabled.
^G/usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
130714 11:23:45 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
130714 11:23:45 InnoDB: The InnoDB memory heap is disabled
130714 11:23:45 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130714 11:23:45 InnoDB: Compressed tables use zlib 1.2.3.4
^G/usr/sbin/mysqld: Can't create/write to file '/tmp/ibcN8p9L' (Errcode: 13)
130714 11:23:45  InnoDB: Error: unable to create temporary file; errno: 13
130714 11:23:45 [ERROR] Plugin 'InnoDB' init function returned error.
130714 11:23:45 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130714 11:23:45 [ERROR] Unknown/unsupported storage engine: InnoDB
130714 11:23:45 [ERROR] Aborting

Here is my some of configurations of /etc/mysql/my.cnf

user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking

Here is my diskspace information which i get by running df -h

Filesystem      Size  Used Avail Use% Mounted on
/dev/vda         20G  2.0G   17G  11% /
udev            246M  4.0K  246M   1% /dev
tmpfs           100M  200K   99M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            248M     0  248M   0% /run/shm

Here is my memory utilization details

             total       used       free     shared    buffers     cached
Mem:           495         93        401          0         16         49
-/+ buffers/cache:         28        467
Swap:            0          0          0

When i run mysql_install_db or mysql_upgrade (as it says in error details) it gives me

Installing MySQL system tables...

Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

You can try to start the mysqld daemon with:

    shell> /usr/sbin/mysqld --skip-grant &

and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /usr/bin/mysql -u root mysql
    mysql> show tables

Try 'mysqld --help' if you have problems with paths.  Using --log
gives you a log in /var/lib/mysql that may be helpful.

Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS.  Another information source are the
MySQL email archives available at http://lists.mysql.com/.

Please check all of the above before mailing us!  And remember, if
you do mail us, you MUST use the /usr/scripts/mysqlbug script!

I have googled alot, some says to reboot and then start mysql service, some suggests to re-install mysql but still i am unable to make it correct. Please help me.

Thanks

share|improve this question

2 Answers 2

up vote 0 down vote accepted

I would try the following:

sudo mv /var/lib/mysql /var/lib/mysql_bak
sudo mysql_install_db
sudo /etc/init.d/mysql start
sudo netstat -anp | grep 3306

Essentially you're backing up your MySQL data directory, then re-initialising it and starting MySQL. The netstat command will check for any processes listening on port 3306.

Also check the error.log again if you have issues starting MySQL.

share|improve this answer
    
thanks Watson, i have updated the question, when i run mysql_install_db or mysql_upgrade it gives me error as i updated in question. –  user1032283 Jul 14 '13 at 13:17
    
No problem - can you also add the permissions of /tmp, as shown by ls -l / | grep tmp? –  Craig Watson Jul 14 '13 at 13:24
    
thanks Watson it has resolve the issue the only issue with which i left is 403 Error of apache, it says Forbidden You don't have permission to access / on this server. and in error.log it says, )Permission denied: /root/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable Would you please guide me i shall be very thankful to you. –  user1032283 Jul 14 '13 at 13:53
    
This does beyond the scope of the original question - though as a free pointer, you shouldn't be using /root for your document root - try /var/www instead. –  Craig Watson Jul 14 '13 at 13:57
    
Watson any know how about this much appreciated; serverfault.com/questions/523229/… –  user1032283 Jul 14 '13 at 15:47

I would first off try what the error line suggests, as in "Please run mysql_upgrade to create it.".

Then, I would check the diskspace on your mysql partition by running df -h and making sure there is enough space available. Also run htop or free -m to check your memory utilization for tmpfs and make sure you have enough space. Unable to write to tmp space in one of those lines implies a space issue.

There looks to also be a problem with usage of innoDB, so that's something that may need further investigation.

Also make sure MySQL is running at the time. I am assuming you cannot start MySQL, judging by your comment, however.

share|improve this answer
    
thanks Peter for you quick response, i have updated the question will you please tell me whats the issue now ? i have triend "mysql_upgrade" but it gives me the same error of socket. –  user1032283 Jul 14 '13 at 12:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.