473,756 Members | 7,560 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Database as Symbolic Link - What am I missing?

Hi,

I've done this before so I don't see what I could doing wrong here.
I'm running mysql 5x on freebsd. I'm using the default data directory
of "/var/db/mysql"

In there I have several dozen mysql datasbases that are functioning
perfectly. I am trying to add a database which will be stored on a
different drive, therefore the entry in "/var/db/mysql" should be a
symbolic link

With mysql running I go...

mkdir /sata2/database/d1
chmod 700 /sata2/database/d1
chown mysql:mysql /sata2/database/d1
Now all I have to do is make a symbolic link and I should be set
ln -s /sata2/database/d1 /var/db/mysql
Change the owner of the symbolic link
chown -h mysql:mysql /var/db/mysql/d1

Doing a directory listing, I see:
lrwxr-xr-x 1 mysql mysql 25 Jun 19 11:24 d1 -/sata2/database/s1

So the symbolic is there and looks to have permissions good. I restart
mysql. Mysql does not show the database "d1". It's as if the database
isn't there.

Just for testing, I tried making a directory "/var/db/mysql/d2" via
command line. OF course, since that is and actual directory, when
restarting mysql, mysql see its.

Jul 24 '07 #1
1 8359
am**********@gm ail.com wrote:
Hi,

I've done this before so I don't see what I could doing wrong here.
I'm running mysql 5x on freebsd. I'm using the default data directory
of "/var/db/mysql"

In there I have several dozen mysql datasbases that are functioning
perfectly. I am trying to add a database which will be stored on a
different drive, therefore the entry in "/var/db/mysql" should be a
symbolic link

With mysql running I go...

mkdir /sata2/database/d1
chmod 700 /sata2/database/d1
chown mysql:mysql /sata2/database/d1
Now all I have to do is make a symbolic link and I should be set
ln -s /sata2/database/d1 /var/db/mysql
Change the owner of the symbolic link
chown -h mysql:mysql /var/db/mysql/d1

Doing a directory listing, I see:
lrwxr-xr-x 1 mysql mysql 25 Jun 19 11:24 d1 -/sata2/database/s1

So the symbolic is there and looks to have permissions good. I restart
mysql. Mysql does not show the database "d1". It's as if the database
isn't there.

Just for testing, I tried making a directory "/var/db/mysql/d2" via
command line. OF course, since that is and actual directory, when
restarting mysql, mysql see its.

You should not symlink tables on systems that do not have a fully
operational realpath() call. (Linux and Solaris support realpath()). You
can check whether your system supports symbolic links by issuing a SHOW
VARIABLES LIKE 'have_symlink' statement.
Symlinks are fully supported only for MyISAM tables. For files used by
tables for other storage engines, you may get strange problems if you
try to use symbolic links.

In the data directory, you always have the table format (.frm) file, the
data (.MYD) file, and the index (.MYI) file. The data file and index
file can be moved elsewhere and replaced in the data directory by
symlinks. The format file cannot.

You can symlink the data file and the index file independently to
different directories.

The .frm file must never be a symbolic link (as indicated previously,
only the data and index files can be symbolic links). Attempting to do
this (for example, to make synonyms) produces incorrect results. Suppose
that you have a database db1 under the MySQL data directory, a table
tbl1 in this database, and in the db1 directory you make a symlink tbl2
that points to tbl1:

shellcd /path/to/datadir/db1
shellln -s tbl1.frm tbl2.frm
shellln -s tbl1.MYD tbl2.MYD
shellln -s tbl1.MYI tbl2.MYI
Jul 25 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7721
by: Conrad | last post by:
Hi, it seems that I have the following issue when trying to create a symbolic link within a script: FROM COMMAND LINE: The owner is set to myself. Thus, it works. FROM WEB PAGE: It doesn't work as expected. I know that it runs as one user at the command line and a different user from the web page. Thus, is it possible to do the following within the script:
22
4239
by: mp | last post by:
i have a python program which attempts to call 'cls' but fails: sh: line 1: cls: command not found i tried creating an alias from cls to clear in .profile, .cshrc, and /etc/profile, but none of these options seem to work. my conclusion is that a python program that is executing does not use the shell (because it does not recognize shell aliases). is this correct?
3
2791
by: TK | last post by:
Hi, how can I check wether a file a symbolic link is? Thanks for help. o-o Thomas
4
3375
by: TK | last post by:
Hi, I have to know whether a typical file (under Linux) a symbolic link is (in the sense of the stat()-Funktion). How can I check it excactly? Thanks for help. o-o THomas
0
1386
by: humbleaptience | last post by:
Hey Ya'll, I basically have a bunch of unix servers with a dataset scrambled through about 10 of them. On unix, I maintain a symbolic link file tree so that for each server it appears to have access to all the files through auto mounting and so forth. I want to be able to access this same file tree from my asp.net web app and NFS - however, it's not working and I've tried everything. Microsoft Services for Unix just doesn't cut it...
11
8133
by: mosscliffe | last post by:
I am trying to create a link to a file, which I can then use in an HTML page. The system is Linux on a hosted web service, running python 2.3. Other than that I have no knowledge of the system. The link is created OK, but when I try to use it as filename for the IMG TAG, it does not get displayed. The page source of the created page is pointing to the link as temp/test1.jpg
2
2868
by: Desmodromic | last post by:
Informix recommend that symbolic links be used for chunks. These links are then used in the dbspace definition. Does this advice hold for DB2? The equivalent would be to create symbolic links for containers and use the link name when defining tablespaces. Wouldn't this allow containers to be physically moved/ renamed without having to use db2relocatedb? I haven't tested this but couldn't you just remove the link, move the container,...
0
1836
by: tony_in_da_uk | last post by:
*** I posted this on comp.lang.c++.moderated a couple days ago, and got a near-flippant response from someone who clearly didn't take the time to consider the import. I replied, and it's still not in evidence. Maybe it's my fault for having reacted with a little annoyance, but anyway I'm tired of waiting days for moderators, have had several posts not get through moderation at all which were certainly not inappropriate, and an email from...
1
4638
by: sora | last post by:
Hi, I've developed a MFC program under VS 6.0. My debugger *was* working fine and I've used it often for my project. Then, one day, the errors below appear and they prevent me from using the debugger. I know that I get these warnings because the OS symbols arn't installed (a few of them loaded fine). As far as I can remember, I didn't touch anything that should mess with the debugger so I don't know how to fix it and I need to be able to...
0
9275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10040
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7248
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3806
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.