Find the answer to your Linux question:
Results 1 to 4 of 4
Hello - this year's project is to learn about MySQL, Apache and PHP and to get them working together to produce web databases. I've got a copy of a book ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru fingal's Avatar
    Join Date
    Jul 2003
    Location
    Birmingham - UK
    Posts
    1,539

    MySQL: problems starting it


    Hello - this year's project is to learn about MySQL, Apache and PHP and to get them working together to produce web databases.

    I've got a copy of a book by O'Reilly which suggests I should compile MySQL from source. This makes sense when trying to get it working with PHP because you then get all the mysql_config files in the right places for PHP to compile against.

    My problem isn't compiling MySQL: that went well; it's getting it to start. A lot of people seem to have this problem.

    I have an error code 13, and Googling won't turn up an answer. It seems to be a problem with mysqld accessing directories. I've tried every combination of chown I can think of. I've copied the MySQL config file (called my.cnf) into /etc . My error message looks like this:
    Code:
    070305 11:43:41  mysqld started
    /usr/local/mysql/libexec/mysqld: Can't read dir of '/root/tmp/' (Errcode: 13)
    /usr/local/mysql/libexec/mysqld: Can't create/write to file '/root/tmp/ibGsqDEW' (Errcode: 13)
    070305 11:43:41  InnoDB: Error: unable to create temporary file; errno: 13
    070305 11:43:41 [ERROR] Can't init databases
    070305 11:43:41 [ERROR] Aborting
    
    070305 11:43:41 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
    
    070305 11:43:41  mysqld ended
    Any clues? I'm using MySQL ver. 4.1.x Version 5.x.x probably has more than I need. In fact I just need to get a working LAMP system to play around with. The annoying thing is that no matter how many combinations of permissions I try (as root) the database still can't start.

    If I install MySQL as an rpm I can start it from Mandriva's front-end ... but then I can't easily get PHP working with it.
    I am always doing that which I can not do, in order that I may learn how to do it. - Pablo Picasso

  2. #2
    Linux Guru fingal's Avatar
    Join Date
    Jul 2003
    Location
    Birmingham - UK
    Posts
    1,539

    Thumbs up Solved!

    No worries. This looked impossible but this page gave me the answer (at the bottom under 'Quick FAQ').

    The solution: as root do export TMPDIR=/tmp then run ./mysqld_safe --user=mysql &

    Without Google I wouldn't have had a chance to sort this out. It seems that when you compile from source, environment variables aren't set up correctly. The error messages are slightly misleading!
    I am always doing that which I can not do, in order that I may learn how to do it. - Pablo Picasso

  3. #3
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,393
    That problem seems to only happen on Mandriva because the use a seperate tmp directory for each user. Another way to resolve the issue is to edit my.cnf and make sure that the temp directory is set to /tmp.

  4. #4
    Linux Guru fingal's Avatar
    Join Date
    Jul 2003
    Location
    Birmingham - UK
    Posts
    1,539
    Quote Originally Posted by daark.child
    That problem seems to only happen on Mandriva because the use a seperate tmp directory for each user. Another way to resolve the issue is to edit my.cnf and make sure that the temp directory is set to /tmp.
    Thanks. Yes, I wondered if it was just a Mandriva thing; the directory tree is a bit different perhaps. What's confusing is that there's a directory called /root/tmp which MySQL says it can't access. So you think, 'Why not? It knows the path to the directory'.

    I found plenty of posts about the problem on other forums. A lot of these were very long, very articulate and completely wrong! Many of them hadn't been resolved because they only focused on the chown and chmod commands.
    I am always doing that which I can not do, in order that I may learn how to do it. - Pablo Picasso

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •