Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL 5.0 and RH9 installation problems (something w/ permissions)

Status
Not open for further replies.

EV1772

Technical User
Jul 31, 2002
31
US
Hello all,

I'm trying to configure MySQL 5.0 on my RH9 box but still continue to run into problems even after the mysql user has been added and permissions have been granted to the /mysql/data directory.

This is what occurs when I try to start the MySQL daemon

[root@pclinux mysql]# ./bin/mysqld_safe &
[1] 6143
[root@pclinux mysql]# Starting mysqld daemon with databases from /root/mysql/data
040203 15:53:17 mysqld ended


[1]+ Done ./bin/mysqld_safe
[root@pclinux mysql]#

This is what I see in my error file:

040203 15:53:17 mysqld started
040203 15:53:17 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...
040203 15:53:17 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 43634.
InnoDB: Doing recovery: scanned up to log sequence number 0 43634
040203 15:53:17 InnoDB: Flushing modified pages from the buffer pool...
040203 15:53:17 InnoDB: Started; log sequence number 0 43634
040203 15:53:17 /root/mysql/bin/mysqld: Can't create/write to file '/root/mysql/data/pclinux.pid' (Errcode: 13)
040203 15:53:17 Fatal error: Can't open privilege tables: Can't open file: 'host.MYI' (errno: 13)
040203 15:53:17 /root/mysql/bin/mysqld: Error on delete of '/root/mysql/data/pclinux.pid' (Errcode: 13)
040203 15:53:17 mysqld ended

Now I'm assuming I had the correct permissions assigned for the user, mysql, for the data directory but I could be wrong. This is what appears when I list the permissions in the mysql directory.

[root@pclinux mysql]# ls -l
total 84
drwxr-xr-x 2 503 users 4096 Dec 22 12:01 bin
-rwxr-xr-x 1 503 users 801 Dec 22 12:00 configure
-rw-r--r-- 1 503 users 19106 Dec 22 11:47 COPYING
drwxr-x--- 4 mysql mysql 4096 Feb 3 15:40 data
drwxr-xr-x 2 503 users 4096 Dec 22 12:00 docs
drwxr-xr-x 2 503 users 4096 Dec 22 12:01 include
-rw-r--r-- 1 503 users 7400 Dec 22 11:47 INSTALL-BINARY
drwxr-xr-x 2 503 users 4096 Dec 22 12:01 lib
drwxr-xr-x 3 503 users 4096 Dec 22 12:00 man
drwxr-xr-x 6 503 users 4096 Dec 22 12:01 mysql-test
-rw-r--r-- 1 503 users 1937 Dec 21 13:01 README
drwxr-xr-x 2 503 users 4096 Dec 22 12:01 scripts
drwxr-xr-x 3 503 users 4096 Dec 22 12:00 share
drwxr-xr-x 5 503 users 4096 Dec 22 12:01 sql-bench
drwxr-xr-x 2 503 users 4096 Dec 22 12:01 support-files
drwxr-xr-x 2 503 users 4096 Dec 22 12:01 tests

This is correct right?

Any help would be greatly appreciated. Thanks in advance!

[peace]
 
Can't create/write to file '/root/mysql/data/pclinux.pid'

guess its this path thats causing the problem, check each folder has enough permissions for mysql to be able to write the pid file here (bear in mind, this is based in root's home and that the perms will be pretty tight from /root onwards.)

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
KarveR,

Thanks so much your reply. Here are my current permissions within the /mysql directory.

[root@pclinux mysql]# ls -l
total 84
drwxr-xr-x 2 root mysql 4096 Dec 22 12:01 bin
-rwxr-xr-x 1 root mysql 801 Dec 22 12:00 configure
-rw-r--r-- 1 root mysql 19106 Dec 22 11:47 COPYING
drwxr-x--- 4 mysql mysql 4096 Feb 4 16:53 data
drwxr-xr-x 2 root mysql 4096 Feb 4 15:39 docs
drwxr-xr-x 2 root mysql 4096 Dec 22 12:01 include
-rw-r--r-- 1 root mysql 7400 Dec 22 11:47 INSTALL-BINARY
drwxr-xr-x 2 root mysql 4096 Feb 4 15:37 lib
drwxr-xr-x 3 root mysql 4096 Dec 22 12:00 man
drwxr-xr-x 6 root mysql 4096 Dec 22 12:01 mysql-test
-rw-r--r-- 1 root mysql 1937 Dec 21 13:01 README
drwxr-xr-x 2 root mysql 4096 Dec 22 12:01 scripts
drwxr-xr-x 3 root mysql 4096 Dec 22 12:00 share
drwxr-xr-x 5 root mysql 4096 Dec 22 12:01 sql-bench
drwxr-xr-x 2 root mysql 4096 Dec 22 12:01 support-files
drwxr-xr-x 2 root mysql 4096 Dec 22 12:01 tests

Do you think I may need to change the owner to mysql for the scripts directory also?

Thanks again!
 
whats the permissions on the /root directory ?

also
drwxr-x--- 4 mysql mysql 4096 Feb 4 16:53 data
seems a bit light on write perms.
Possbly edting your my.ini or my.cnf and setting the location of the pid file to say /tmp would be safer than messing with your /root directory tho.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Sorry to butt in but where is this error file you are looking at, I have exactly the same problem that's all

Jo
 
No problem Jo. The error file should be in the data folder of your mysql directory. It should be something like name-of-your-linuxws.err. In my case it was pclinux.err.

KarveR,

Here are the permissions for my /root:

[root@pclinux root]# ls -l
total 34680
-rw-r--r-- 1 root root 1636 Jun 3 2003 anaconda-ks.cfg
-rw-r--r-- 1 root root 23860 Jun 3 2003 install.log
-rw-r--r-- 1 root root 3993 Jun 3 2003 install.log.syslog
drwxr-xr-x 3 administrator users 4096 Jul 10 2003 LinNeighborhood-0.6.2.glibc-i386
-rw------- 1 root root 471040 Jul 10 2003 LinNeighborhood-0.6.2.glibc-i386.tar
drwxr-xr-x 4 root root 4096 Jan 15 14:08 mnt
drwxr-xr-x 14 root mysql 4096 Feb 4 16:03 mysql
-rw------- 1 root root 24241085 Jan 29 13:32 mysql-standard-5.0.0-alpha-pc-linux-i686.tar.gz
drwxrwxrwx 13 1000 1000 4096 Jul 24 2003 netatalk-1.6.3
-rw------- 1 root root 4352000 Jul 24 2003 netatalk-1.6.3.tar
drwxr-xr-x 9 783 783 4096 Apr 6 2003 samba-2.2.8a
-rw------- 1 root root 5463358 Jun 5 2003 samba-latest.tar.gz
-rw------- 1 root root 861998 Jan 16 16:52 up2date-3.1.23.2-1.src.rpm

I agree about not messing with the root directory but I just wanted to see the daemon up and running first. What else can I do to assign more perms for mysql for the /data directory? Are there any other directories I should change the owner as well as perms?

Thanks again for your help. Much appreciated!
 
nah I meant from /
so i can see something like:
drwxr-x--- 29 root root 8192 Feb 4 20:39 root

as mine is it wont allow mysql to write anywhere into it.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Oh OK. Here's what it looks like from the top /:

[root@pclinux /]# ls -l
total 204
drwxr-xr-x 2 root root 4096 Jun 3 2003 bin
drwxr-xr-x 3 root root 4096 Jan 26 12:06 boot
drwxr-xr-x 20 root root 118784 Feb 3 13:50 dev
drwxr-xr-x 64 root root 8192 Feb 3 13:46 etc
drwxr-xr-x 4 root root 4096 Feb 3 10:27 home
drwxr-xr-x 2 root root 4096 Jan 24 2003 initrd
drwxr-xr-x 9 root root 4096 Jun 9 2003 lib
drwx------ 2 root root 16384 Jun 2 2003 lost+found
drwxr-xr-x 2 root root 4096 Jan 27 2003 misc
drwxr-xr-x 5 root root 4096 Jun 3 2003 mnt
drwxr-xr-x 2 root root 4096 Jan 24 2003 opt
dr-xr-xr-x 81 root root 0 Feb 3 08:46 proc
drwxr-x--- 28 root root 4096 Feb 4 17:03 root
drwxr-xr-x 2 root root 8192 Jun 9 2003 sbin
drwxr-xr-x 3 root root 4096 Jun 3 2003 tftpboot
drwxrwxrwt 11 root root 4096 Feb 5 04:03 tmp
drwxr-xr-x 15 root root 4096 Jun 2 2003 usr
drwxr-xr-x 21 root root 4096 Jun 3 2003 var

Thx!
 
see, same as mine, only owner has write perms to /root, means that no other group can write anywhere down the tree.

If its not public, and yours ,you can :
% chmod 770 root

This should solve your problem, however it would be far more appropriateto modify the config and have teh .pid file written to somewhere more appropriate.

normally mysql would be installed in /var/lib on redhat, not /root ...


______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
That makes sense. I actually wanted to try and istall mysql into /var/lib but when I tried to delete mysql from /root with rm -r -f it would still remain there if I performed a locate. However if I tried to navigate to the directory or do a ls it would say the directory does not exist. What else do I need to do to permanently delete the mysql directory and start from scratch again?

Thx!
 
SUCCESS!!!

OK 2 things:

1) To answer my question from the previous post, I read in this thread:


The updatedb command actually registers which files are deleted into its database every night. Locate only searches this database and not the entire system to see if a file has been deleted which is why the deleted files continue to show up eventhough they have been deleted.

2) I installed the mysql directory into /usr/local/mysql and then applied the appropriate permissions to the data folder. After the databases were installed through the ./configure command, I was able to start the daemon with ./bin/mysqld_safe &.

HTH others!

Once again thanks KarveR for all your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top