473,385 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 8328
am**********@gmail.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
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...
22
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...
3
by: TK | last post by:
Hi, how can I check wether a file a symbolic link is? Thanks for help. o-o Thomas
4
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
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...
11
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....
2
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...
0
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.