LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-03-2011, 10:16 PM   #1
mei0fei
Member
 
Registered: Jul 2011
Posts: 38

Rep: Reputation: Disabled
why cannot cd mysql datadir?


here is mysql datadir:
mei@ubuntu:~$ ls -ld /var/lib/mysql
drwx------ 5 mysql mysql 4096 2011-08-04 09:35 /var/lib/mysql

mei@ubuntu:~$ cd /var/lib/mysql
bash: cd: /var/lib/mysql: Permission denied

mei@ubuntu:~$ sudo cd /var/lib/mysql
sudo: cd: command not found

mei@ubuntu:~$ sudo cp -rf /var/lib/mysql /mysql1
mei@ubuntu:~$ cd /mysql1

mei@ubuntu:/mysql1$ ls -la
total 12
drwxr-xr-x 3 mysql mysql 4096 2011-08-04 10:04 .
drwxr-xr-x 24 root root 4096 2011-08-04 09:20 ..
drwx------ 5 root root 4096 2011-08-04 10:04 mysql

mei@ubuntu:/mysql1$ cd mysql
bash: cd: mysql: Permission denied

I need help! thanks
 
Old 08-04-2011, 12:10 AM   #2
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 495

Rep: Reputation: 212Reputation: 212Reputation: 212
Quote:
Originally Posted by mei0fei View Post
Code:
mei@ubuntu:/mysql1$ ls -la
total 12
drwxr-xr-x  3 mysql mysql 4096 2011-08-04 10:04 .
drwxr-xr-x 24 root  root  4096 2011-08-04 09:20 ..
drwx------  5 root  root  4096 2011-08-04 10:04 mysql

mei@ubuntu:/mysql1$ cd mysql
bash: cd: mysql: Permission denied
The directory has read, write and execute permissions for the superuser only. Either log in as root with su -, or change the permissions on the directory:

Code:
su -c 'chmod 755 <directory>'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL with alternative datadir elflesnoy Linux - Server 2 12-22-2010 02:58 PM
[SOLVED] MySQL datadir from previous install mwjones Linux - Server 1 06-22-2010 09:55 AM
Trying to move datadir of mysql edudirectories Linux - Enterprise 1 02-14-2009 08:29 PM
Start MySQL with a non-default datadir nifflerX Linux - Enterprise 9 02-28-2006 06:42 AM
Trying to move datadir of mysql edudirectories Linux - Software 2 02-10-2006 07:25 AM


All times are GMT -5. The time now is 12:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration