Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am new to Ubuntu. I am running Ubuntu 12.10. I am trying to install apache,php,mysql. However I have installed apache and it is running perfectly.

sudo apt-get install apache2

But when I tried to install mysql using following command

sudo apt-get install mysql-server 

After download, it asked for password but after entering and confirming password. I get following error message.

Unable to set password for the Mysql "root" user

An error occurred while setting password for the mysql
administrative user.This may have happened because the account already has a password, or because of a communication problem with the Mysql server.
You should check the account's password after the package installation.
Please read the /usr/share/doc/mysql-server-5.5/README.Debian file for more information.

after clicking on the ok button on the prompt I am getting following message on terminal

Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)

Mysql error log says

130209 14:26:37 [Note] Plugin 'FEDERATED' is disabled.
130209 14:26:37 InnoDB: The InnoDB memory heap is disabled
130209 14:26:37 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130209 14:26:37 InnoDB: Compressed tables use zlib 1.2.7
130209 14:26:37 InnoDB: Using Linux native AIO
mysqld: Can't create/write to file '/tmp/ibNuz7q0' (Errcode: 13)
130209 14:26:37  InnoDB: Error: unable to create temporary file; errno: 13
130209 14:26:37 [ERROR] Plugin 'InnoDB' init function returned error.
130209 14:26:37 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130209 14:26:37 [ERROR] Unknown/unsupported storage engine: InnoDB
130209 14:26:37 [ERROR] Aborting

I have searched for this problem, but nothing worked for me. Please help.

share|improve this question
1  
Check if you have mysql-server already installed by running ps -e | grep mysqld. If you see any output that means that it is already installed. – green7 Feb 9 at 8:04
I am not getting any output for this – Devendra Verma Feb 9 at 8:17
The mysql error that you posted could indicate a problem with your /etc/mysql/my.cnf. If you modified that file or any file in the /etc/mysql directory, restore the originals and try again. – Richard Ayotte Feb 10 at 14:49
Nathan, I'm facing the same problem in this post and I've already followed the same instructions as green7 posted and yours too. I can't even understand why mysql stopped working. I'd be happy if you could give me further assistance. Edit: Just to let you know that all of that happened because I began receiving from nowhere the following message when I try to install mysql: ERROR: 1146 Table 'mysql.user' doesn't exist Thanks in advance. – Gabriel May 7 at 1:01

2 Answers

I think the reason is that mysql is not able to access your /tmp/ directory, as it says in the line

mysqld: Can't create/write to file '/tmp/ibNuz7q0' (Errcode: 13)

Run the following commands in a terminal:

sudo su
chown root:root /tmp
chmod 1777 /tmp
/usr/sbin/mysqld &

Explanation:

  • sudo su : To run the following commands as root.
  • chown root:root /tmp : Make the user root of root group the owner of /tmp.
  • chmod 1777 /tmp : Change the permissions of /tmp so that it is accessable to all the users and only the owner or the root can delete the files in that directory. (More on file permissions here)
  • /usr/sbin/mysqld & : Start the mysqld daemon.
share|improve this answer
after entering last command i am getting this message # /etc/init.d mysqld start bash: /etc/init.d: Is a directory – Devendra Verma Feb 9 at 13:25
modified the answer – green7 Feb 9 at 13:53
I am getting this output after /usr/sbin/mysqld & /usr/sbin/mysqld & [1] 3497 . How do I check if mysql is running – Devendra Verma Feb 10 at 7:06
To check if your mysql is running, run ps -e | grep mysqld and if you get some output, it is running fine. – green7 Feb 10 at 7:48
thanks @green7 here is the output ps -e | grep mysqld 1075 ? 00:00:04 mysqld – Devendra Verma Feb 10 at 8:02
show 4 more comments

Type "sudo apt-get purge mysql-server && sudo apt-get install mysql-server" if that does not work please leave a comment on my answer and I will work with you to solve this issue.

share|improve this answer

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.