Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Ok, I have just compiled apache (2.0.52) and php (5.03) on my Mandrake 10.1 system. I have also installed the mysql 4.1.9 binary from the mysql site. I have installed all in /usr/local and apache and php work fine, but everytime i try and start mysql I get the following error.
#Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/localhost.pid
050119 08:19:23 mysqld ended
Here is the error log,
050119 08:19:23 mysqld started
050119 8:19:23 [Warning] Ignoring user change to 'sr=mysql' because the user was set to 'mysql' earlier on the command line
/usr/local/mysql/bin/mysqld: Can't read dir of '/root/tmp/' (Errcode: 13)
/usr/local/mysql/bin/mysqld: Can't create/write to file '/root/tmp/ibt8j5Iu' (Errcode: 13)
050119 8:19:23 InnoDB: Error: unable to create temporary file; errno: 13
050119 8:19:23 [ERROR] Can't init databases
050119 8:19:23 [ERROR] Aborting
now, I know the error is to do with the permissions on /root/tmp, but how can I fix this problem so that it uses /tmp instead of /root/tmp. I have searched on google and other people are having this problem but I haven't got an answer that worked for me.
There should/ought to be a /etc/mysql/my.cnf OR somewhere similar (depending on what your startup script looks like) that gives a configuration to mysql. You have a few to choose from, my-huge.cnf for big memory systems, and down from there. It should be in the source directory (haven't done a source install for a while, could be wrong) where the binary lives that you untar. If not, I'm sure there are places on their site to grab it, or you can copy mine:
Code:
# One can use all long options that the program supports.
# Run the program with --help to get a list of them.
#
# The following values assume you have at least 32M RAM!
[client]
#password = my_password
port = 3306
socket = /var/run/mysqld/mysqld.sock
[safe_mysqld]
err-log = /var/log/mysql/mysql.err
[mysqld]
skip-innodb
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
log-error = /var/log/mysql/mysqld.err
# If set, mysql logs all queries(general query log). This will be deprecated in
# 5.0. This logs all queries, even error queries and is slow.
# log = /var/log/mysql/mysql.log
#
# If you really need logging, use rather binary logging. Especially when doing
# replication. Read
# file:/usr/share/doc/mysql-*/manual.html.gz#Replication
# You can use PURGE MASTER LOGS TO '$hostname-bin.010' to get rid of old logs
# from $hostname-bin.01 up to $hostname-bin.09 while the slave server is
# running.
# Before doing that, check which logfile slave curently uses by running
# mysql> SHOW SLAVE STATUS
# To list logfiles on master do:
# mysql> SHOW MASTER LOGS
# Then use PURGE for those not needed anymore only! Never remove the files
# manually!
#
# Also consult RESET MASTER and RESET SLAVE commands before doing any changes
# mysql> RESET MASTER - Deletes all binary logs listed in the index
# file, resetting the binlog index file to be empty.
# mysql> RESET SLAVE - Makes the slave forget its replication position in
# the master logs.
# mysql> SET SQL_LOG_BIN=0 - this turns off logging (execute on MASTER only)
# mysql> SET SQL_LOG_BIN=1 - this turns on logging (execute on MASTER only)
#
# log-bin
# set-variable = binlog-do-db=non_existant
# set-variable = binlog-ignore-db=database_name
#
# server-id has to unique for each master or slave in your network,
# lets use last number from IP address
# server-id = 207
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-locking
set-variable = key_buffer=16M
set-variable = max_allowed_packet=1M
set-variable = thread_stack=256K
# keep secure by default!
#bind-address = 127.0.0.1
port = 3306
# this can make it even more secure:
#skip-networking
[mysqldump]
quick
set-variable = max_allowed_packet=1M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
set-variable = key_buffer=16M
Remember to run an updatedb if you didn't when searching for that file
Ok, I copied /usr/local/mysql/supportfiles/my-medium.cnf to /etc/mysql and changed the tmpdir variable to /tmp, but I still get the error. I then deleted it from /etc/mysql and put it in /usr/local/mysql/data as suggested on the notes, changed the tempdir variable to /tmp, but still the same error, it keeps wanting to write to /root/tmp. Could part of this be coz Mandrake configures users temporary directories as /userid/tmp.
Still, it **should** be reading the config file and acting accordingly. You can use /var/lib/mysql as well for global server changes, but that may be distro specific.
At this point I really don't know what to tell you.... When trying to start the server, specify the config file to ensure it's reading it.
I have searched on google for days, there are lots of people with this problem but nobody seems to have solved it. I'll just have to reluctantly use the Mandrake rpms. Thanks a lot for the help though.
No problem, I'd probably submit a bug report if I were you, if there are tons of people with the problem and no solution turning up after an in depth google, it's the next step.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.