LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-09-2008, 07:14 PM   #1
pickuprover
LQ Newbie
 
Registered: Jan 2008
Posts: 7

Rep: Reputation: 0
Mysql can't create/write to mysql.pid


Ok... having some issues with getting Mysql up and running...
the system..
PII box with 512 ram
Fedora 7 (Moonshine)
Mysql-5.0.45-linux-i686 (that is the build I downloaded.

Everytime I try to run the mysqld_safe script I get
"nohub: ignoring input and redirecting stderr to stdout
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysqld/mysqld.pid"

Now after extensive searching through the data bases here I ended up in /var/log/mysqld.log.
Now I see when I started the server each time and what happened. Each time mysqld started, I get a database was not shut down properly, then a bunch a stuff about restoring half written pages, apply batch of log records, progress in percents followed by a bunch of numbers 3-99, apply batch completed (everything up till this point I am not too worried about because I think that the next 2 lines explains why the data base was not shut down properly....
[ERROR] /usr/local/mysql/bin/mysqld: can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2)
[ERROR] Can't start server; can't create PID file no such file or directory.
mysqld ended

(I assume that the 080108 and time stamps were not important so have eliminated them.)

When I look for /var/run/mysqld/mysqld.pid it does not exist at all, nor does the directory /var/run/mysqld.

Now does this mean I missed something in the install process, or is there a setting somewhere that I have wrong. Any help would be greatly appreciated. Also I hope this was the right forum to put this in (it was either this one or the server forum, hopefully a mod will move if it should be in the server forum to prevent me from double posting. thanks.)

Cheers.

Last edited by pickuprover; 01-09-2008 at 07:21 PM.
 
Old 01-09-2008, 07:16 PM   #2
KnightHawk
Member
 
Registered: Aug 2005
Posts: 128

Rep: Reputation: 15
What user are you using to do all this with? Don't be using root. Mysql is supposed to have its own user with its home directory pointed to the database files.

when you try and start mysql server it will try to run as this user, and if you've been doing everything as root up until now, will fail miserably.
 
Old 01-09-2008, 07:46 PM   #3
pickuprover
LQ Newbie
 
Registered: Jan 2008
Posts: 7

Original Poster
Rep: Reputation: 0
running as mysql as user (all the permissions seem to be with mysql user when I did a search on ownership)
I tried it with root and got the same message (thought I should get a permission denied when I tried to start it with root as mysql is the owner of the program and all files.)
 
Old 01-09-2008, 07:52 PM   #4
pickuprover
LQ Newbie
 
Registered: Jan 2008
Posts: 7

Original Poster
Rep: Reputation: 0
Here is the first 2 instances in the log....

080108 14:56:04 mysqld started
nohup: ignoring input
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
080108 14:56:04 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
080108 14:56:05 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
080108 14:56:05 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
080108 14:56:06 InnoDB: Started; log sequence number 0 0
080108 14:56:06 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2)
080108 14:56:06 [ERROR] Can't start server: can't create PID file: No such file or directory
080108 14:56:06 mysqld ended

080108 15:00:32 mysqld started
nohup: ignoring input
080108 15:00:33 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
080108 15:00:33 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 36808.
InnoDB: Doing recovery: scanned up to log sequence number 0 43655
080108 15:00:33 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
080108 15:00:33 InnoDB: Started; log sequence number 0 43655
080108 15:00:33 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2)
080108 15:00:33 [ERROR] Can't start server: can't create PID file: No such file or directory
080108 15:00:33 mysqld ended

and the last 2 incase that helps any.

080109 19:34:00 mysqld started
nohup: ignoring input
080109 19:34:01 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
080109 19:34:01 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 36808.
InnoDB: Doing recovery: scanned up to log sequence number 0 43655
080109 19:34:01 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
080109 19:34:01 InnoDB: Started; log sequence number 0 43655
080109 19:34:01 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2)
080109 19:34:01 [ERROR] Can't start server: can't create PID file: No such file or directory
080109 19:34:01 mysqld ended

080109 19:59:02 mysqld started
nohup: ignoring input
080109 19:59:02 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
080109 19:59:02 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 36808.
InnoDB: Doing recovery: scanned up to log sequence number 0 43655
080109 19:59:02 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
080109 19:59:03 InnoDB: Started; log sequence number 0 43655
080109 19:59:03 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2)
080109 19:59:03 [ERROR] Can't start server: can't create PID file: No such file or directory
080109 19:59:03 mysqld ended
 
Old 01-09-2008, 07:54 PM   #5
KnightHawk
Member
 
Registered: Aug 2005
Posts: 128

Rep: Reputation: 15
Quote:
Originally Posted by pickuprover View Post
running as mysql as user (all the permissions seem to be with mysql user when I did a search on ownership)
I tried it with root and got the same message (thought I should get a permission denied when I tried to start it with root as mysql is the owner of the program and all files.)
No if you did it as root, you wont get permission denied, that don't happen to root.

And I'm sorry, somehow I missed this when I first read it, but by all means if you don't have the /var/run/mysqld directory, go ahead and create it, and make sure mysql.mysql owns it. That does in fact seem to be what its complaining about.
 
Old 01-09-2008, 08:03 PM   #6
pickuprover
LQ Newbie
 
Registered: Jan 2008
Posts: 7

Original Poster
Rep: Reputation: 0
Thank-you, it is now up and running.... yay.... I was soo close to on my own, but thankfully there are forums out there. KnightHawk, I thank you very much.
I am so glad I switched to Linux, in less than a week since I downloaded it onto the old computer I feel like I know 20 times more about my operating system than I ever did with Windows.... once again, thanks.
 
Old 01-14-2008, 08:58 PM   #7
wreckage
LQ Newbie
 
Registered: Jan 2008
Posts: 1

Rep: Reputation: 0
hi there! i'm a newbie in installing MySQL on a linux box. I can't start my MySQL (Timeout error occurred trying to start MySQL Daemon. - i got this error) and when i look at the /var/log/mysqld.log i got the following error.

080115 10:22:22 mysqld started
080115 10:22:26 InnoDB: Started; log sequence number 0 43634
080115 10:22:26 [ERROR] /usr/libexec/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 13)
080115 10:22:26 [ERROR] Can't start server: can't create PID file: Permission denied
080115 10:22:26 mysqld ended

this is my /etc/my.cnf

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

added information:

[root@localhost etc]# rpm -qa | grep mysql
mysql-server-4.1.12-3.RHEL4.1
mysql-devel-4.1.12-3.RHEL4.1
php-mysql-4.3.9-3.9
libdbi-dbd-mysql-0.6.5-10.RHEL4.1
mysqlclient10-3.23.58-4.RHEL4.1
mysql-4.1.12-3.RHEL4.1

thanks in advance!

Last edited by wreckage; 01-14-2008 at 09:02 PM.
 
  


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
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Newbie 1 06-23-2007 03:35 PM
mysql pid error nbf Slackware 7 06-13-2007 07:45 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
ERROR! MySQL PID file could not be found! Niceman2005 Linux - Software 1 06-02-2005 06:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:46 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
Open Source Consulting | Domain Registration