LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   Can I place mysql dbs in a folder that I define (https://www.linuxquestions.org/questions/suse-opensuse-60/can-i-place-mysql-dbs-in-a-folder-that-i-define-337047/)

macmichael01 06-25-2005 10:23 AM

Can I place mysql dbs in a folder that I define
 
I have more than one os installed on my computer and I would like to place my mysql dbs on my fat 32 partition so that all os's can have access to the same db. I have a folder on my fat 32 called mysql_dbs and I don't know how to point mysql, under suse, to this folder on my fat 32 fs where the dbs are stored? any suggestions??

david_ross 06-25-2005 10:50 AM

When you start mysql just pas it the --datadir option - ie:
mysqld_safe --datadir=/path/to/mysql/data

You can also use the my.cnf config file.

macmichael01 06-25-2005 12:41 PM

ok so here is what i did

macmichael01@linux:/> mysqld_safe --datadir=file:/windows/D/my_db/data
Starting mysqld-max daemon with databases from file:/windows/D/my_db/data
STOPPING server from pid file file:/windows/D/my_db/data/linux.pid
050625 12:32:34 mysqld ended

am I missing a file? maybe linux.pid???

I dont know what I did but it doesn't seem to work now. Maybe I need to restart! I shall try that. I looked for the file my.cnf in the etc/ folder and could not find a place in that file where I could by the directory path. my DB is on a Fat 32 partition so I hope that won't be a problem.

david_ross 06-26-2005 01:26 PM

Make sure mysql has read and write permissions to the data directory and sub directories.

macmichael01 06-26-2005 05:48 PM

Below is what is in the mysql log file if this helps any. As I mentioned earlier, my db is located on a fat 32 FS and I recently changed the settings to give read and write access to the fat 32 FS by setting the unmask=000. The gid=users and the mysql is part of that group what else should I do if it is a read write error? One thing that I did knotice is that I can't goto the directories and right click to change the permissions. I guess the fstab sets the permissions to global for the whole partition. what should i do?


here is the line in my fstab for the fat 32 FS
------------------------------------------------------
/dev/hda4 /windows/D vfat users,gid=users,umask=000,iocharset=utf8 0 0


here is what php has to say when trying to load my page
--------------------------------------------------------
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /windows/D/web_stuff/index.php on line 5

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /windows/D/web_stuff/index.php on line 6

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /windows/D/web_stuff/index.php on line 8
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)


here is the mysql log file
-----------------------------------------------------
050626 17:26:39 mysqld started
050626 17:26:39 Can't start server: Bind on TCP/IP port: Address already in use
050626 17:26:39 Do you already have another mysqld server running on port: 3306 ?
050626 17:26:39 Aborting

050626 17:26:39 /usr/sbin/mysqld-max: Shutdown Complete

050626 17:26:39 mysqld ended

050626 17:31:16 mysqld started
050626 17:31:16 Warning: Can't create test file dir=file:/windows/D/my_db/data/linux.lower-test
/usr/sbin/mysqld-max: Can't change dir to 'dir=file:/windows/D/my_db/data/' (Errcode: 2)
050626 17:31:16 Aborting

050626 17:31:16 /usr/sbin/mysqld-max: Shutdown Complete

050626 17:31:16 mysqld endedf

david_ross 06-28-2005 01:35 PM

Can you post the output from:
netstat -nlp


All times are GMT -5. The time now is 04:51 PM.