LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-06-2012, 09:33 AM   #1
linuxgeek0
LQ Newbie
 
Registered: Sep 2012
Posts: 4

Rep: Reputation: Disabled
Question MySQL Permissions Messed


Hello everyone!

I am a linux newbie, working on centos & unbuntu ( backtrack) these days.

i have setup a small internal web development server on centos 6.3. LAMP is installed and everything was working fine except vnc freeze problem.

Today what i did is changed the /var directory owner to vnc (a normal user) from root. I also clicked on "Apply Permissions to Enclosed Files"

After that smb,nmb httpd and mysql went down these are the services which I noticed down. I was unable to start these services so what I did is i changed /var owner back to root and i clicked Apply Permissions to Enclosed Files button again :/.

Now my HTTPD, smb and nmb is up and working file. By MySQL failed.

These are the logs.

Code:
[root@dev-server /]# /etc/init.d/mysqld restart
Stopping mysqld:                                           [  OK  ]
MySQL Daemon failed to start.
Starting mysqld:                                           [FAILED]
and my mysqld.log file

Code:
/usr/libexec/mysqld: Can't create/write to file '/tmp/ibk288R4' (Errcode: 13)
120906 16:57:45  InnoDB: Error: unable to create temporary file; errno: 13
120906 16:57:45 [ERROR] Plugin 'InnoDB' init function returned error.
120906 16:57:45 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
120906 16:57:45 [ERROR] /usr/libexec/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 13)
120906 16:57:45 [ERROR] Can't start server: can't create PID file: Permission denied
120906 16:57:45 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
120906 16:59:22 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/libexec/mysqld: Can't create/write to file '/tmp/ibhSLvlO' (Errcode: 13)
120906 16:59:22  InnoDB: Error: unable to create temporary file; errno: 13
120906 16:59:22 [ERROR] Plugin 'InnoDB' init function returned error.
120906 16:59:22 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
120906 16:59:22 [ERROR] /usr/libexec/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 13)
120906 16:59:22 [ERROR] Can't start server: can't create PID file: Permission denied
120906 16:59:22 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
120906 17:05:56 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/libexec/mysqld: Can't create/write to file '/tmp/iboxr0rA' (Errcode: 13)
120906 17:05:56  InnoDB: Error: unable to create temporary file; errno: 13
120906 17:05:56 [ERROR] Plugin 'InnoDB' init function returned error.
120906 17:05:56 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
120906 17:05:56 [ERROR] /usr/libexec/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 13)
120906 17:05:56 [ERROR] Can't start server: can't create PID file: Permission denied
120906 17:05:56 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
[root@dev-server log]# cat mysqld.log

While accessing phpmyadmin

Code:
phpMyAdmin - Error

Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.
Now i have no idea how to reset the permissions back. I have 4 mysql dbs with important data. So unistalling and installing back would be the last option.

Thanks.
 
Old 09-06-2012, 10:34 AM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,869

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Change the owner:group for /var/lib/mysql and sub-directories to mysql:mysql to start and see if that helps.
Change to /var/lib/ directory as root and run the command: chown -R mysql:mysql mysql/
 
Old 09-08-2012, 01:47 AM   #3
linuxgeek0
LQ Newbie
 
Registered: Sep 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Update

Quote:
Originally Posted by yancek View Post
Change the owner:group for /var/lib/mysql and sub-directories to mysql:mysql to start and see if that helps.
Change to /var/lib/ directory as root and run the command: chown -R mysql:mysql mysql/
Before this.

I tried changed these permissions:

Code:
sudo chgrp mysql /var/run/mysqld/
sudo chmod g+w /var/run/mysqld/

(this file was not there so i created it)
sudo chgrp mysql /var/run/mysqld/mysqld.pid
sudo chmod g+w /var/run/mysqld/mysqld.pid

mysqld.log

Code:
120908 09:34:21 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120908  9:34:21  InnoDB: Initializing buffer pool, size = 8.0M
120908  9:34:21  InnoDB: Completed initialization of buffer pool
120908  9:34:22  InnoDB: Started; log sequence number 0 322798698
120908  9:34:22 [ERROR] /usr/libexec/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 13)
120908  9:34:22 [ERROR] Can't start server: can't create PID file: Permission denied
120908 09:34:22 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
after changing permissions i had some luck. but still errcode:13 is there. What yancek suggested is not making any difference in the log. May be it is somthing with /usr/libexec/mysqld right now mysqld permission is mysql:mysql
 
Old 09-08-2012, 02:21 AM   #4
linuxgeek0
LQ Newbie
 
Registered: Sep 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
phpmyadmin

I changed these permissions

Code:
chmod 755 /var/run
chmod 755 /var/run/mysqld
and that did the trick

Code:
Starting mysqld:                                           [  OK  ]
Now all websites are working but I am still unable to access phpmyadmin.

Code:
phpMyAdmin - Error

Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I messed up with permissions mfrangos79 Linux - Security 4 07-20-2005 09:58 PM
messed up permissions Smokey Slackware 5 10-29-2004 01:17 PM
I messed up my / permissions np complete Linux - General 4 10-29-2004 09:17 AM
Messed up my permissions usercsr Slackware 7 07-08-2004 12:21 PM
I think I messed up my permissions... jeffreybluml Linux - Newbie 4 03-25-2004 07:12 PM


All times are GMT -5. The time now is 06:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration