Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

First I created a dir to hold my database data

mkdir /var/www/db_test

Then used symbolic links

ln -s /var/www/db_test/ /var/lib/mysql/

When I entered /var/lib/mysql/, I saw db_test dir with shortcut icon with all my exist databases. But I cannot connect to db_test in php script, even when I tried to chmod and restart apache and mysql server.

share|improve this question
Check your /var/log/syslog for audits from AppArmor, that sounds like something it would forbid – charlesbridge May 24 '12 at 11:27
It said: May 25 13:51:15 ubuntu kernel: [ 318.039386] type=1400 audit(1337928675.784:34): apparmor="DENIED" operation="open" parent=1 profile="/usr/sbin/mysqld" name="/var/www/db_test/db.opt" pid=995 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=114 ouid=114 May 25 13:51:15 ubuntu kernel: [ 318.039529] type=1400 audit(1337928675.784:35): apparmor="DENIED" operation="open" parent=1 profile="/usr/sbin/mysqld" name="/var/www/db_test/" pid=995 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=114 ouid=114 – duy May 25 '12 at 7:36
Try sudo aa-complain /usr/sbin/mysqld to have it log audits but not enforce them (help.ubuntu.com/community/AppArmor) – charlesbridge May 25 '12 at 11:11

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.