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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Messed up dir structure; MySQL cant find files

Status
Not open for further replies.

benmg

Technical User
Apr 23, 2002
2
CN
Hi All

I have been asked to do somework on our company database, which is still in the developmental stages. However, every time I try to access the database I get a connection error. Further investigation has revealed that the MySQL daemon is not running. If I try to run 'mysqld' I get an error saying file not found. I did eventually find 'mysqld', it is in /usr/local/libexec/. If I run 'safe_mysqld' I get an error message (see below).

---------
touch: /usr/local/mysql/var/qube.us-sinosphere.com.err: No such file or directory

chown: /usr/local/mysql/var/qube.us-sinosphere.com.err: No such file or directory

Starting mysqld daemon with databases from /usr/local/mysql/var
/usr/local/bin/safe_mysqld: /usr/local/mysql/var/qube.us-sinosphere.com.err: No such file or directory
--------

I checked, there is no '/usr/local/mysql/var/' directory on our system. All mysql related files a spread throught several other directories. So I guess I need to manually configure mysql to look in a different directory when it starts. Only problem is I don't know how to do this. Do I need to recompile MySQL or can I just add some option for 'path name' when starting the daemon?

Two other questions, how can I determine what port mysql is using? and why can't the 'mysqld' file not be found when it is there (in the /usr/var/libexec/ directory)?

Regards, Ben
 
I just changed the settings of my '/etc/my.cnf' file. It now reads as follows:
----------
[mysqld]
datadir=/usr/local/var
socket=/tmp/mysql.sock
port=3306
user=mysql
log

[mysql.server]
basedir=/usr/local
------------

When I run safe_mysqld I get the following set of errors.

--------
020424 11:09:57 mysqld started
/usr/local/libexec/mysqld: File './qube.log' not found (Errcode: 13)
020424 11:09:57 Could not use qube.log for logging (error 13)
020424 11:09:57 /usr/local/libexec/mysqld: Can't create/write to file '/usr/local/var/qube.us-sinosphere.com.pid' (Errcode: 13)
020424 11:09:57 /usr/local/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
020424 11:09:57 /usr/local/libexec/mysqld: Error on delete of '/usr/local/var/qube.us-sinosphere.com.pid' (Errcode: 13)
020424 11:09:57 mysqld ended
--------

I have searched for 'qube.log' but am unable to find it anywhere.

'host.frm' does exist. It is in '/usr/local/var/mysql/'.

Do you think the errors relating to creating/writing files is permissions related?

Also, what should the 'basedir' path point to?

Sorry about the long list of questions.

Regards, Ben
 
You can turn off loggin from within mysql using \t from the command line.

Most of the errors look like permissions. ***************************************
Party on, dudes!
[cannon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top