Brant Fitzsimmons wrote:
SOTL wrote:

Hi All

As some of you are aware I started last week trying to make a data base using MySQL.

I that light I have a nice book, some book examples, and questions that are not answered in the book.

This computer is set up with all data located on a separate partition called /home/trunk/Common_Data which allows both the Linux and MS OS to see the data.. Yea I know strange location not using /mnt/Common_Data/{file name or directory} but I like it that way. Anyway I would like to place my data bases in the same location.

Currently when I create a db it is located in /var/lib/mysql/{file name} so I preceded to copy one of the db I had made called "testdb" to my desired location. Then I tried to access "testdb" or as the db people say connect to "testdb".
Anyway I tried the following


use /home/trunk/Common_Data/testdb

plus a few variations of this eachtime receiving the response that the db which MC says exist does not exist.

Would some kind person please explain how one creates, connects, and uses a db in any other directory except /var/lib/mysql/*.

Thanks

Frank


All of the following must be done as root.

Turn off your mysql server process:

*# service mysql stop

*Copy your databases to the new location:

*# cp -a /var/lib/mysql /home/trunk/Common_Data/

*Rename your current mysql directory to keep it safe until you know that your changes are working properly:

*# mv /var/lib/mysql /var/lib/mysql_backup_20050217

*Create a symlink in /var/lib/ to the new location:

*# ln -s **/home/trunk/Common_Data/mysql /var/lib/mysql

*Restart the server:

*# service mysql start*



or,

stop mysql server,

edit /etc/my.cnf

change,

datadir=/var/lib/mysql

to

datadir=/home/trunk/Common_Data/

move the data to new location (including the system mysql database)

then restart mysql server

--
Thanks,

David


____________________________________________________
Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com
____________________________________________________

Reply via email to