LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-20-2011, 09:29 AM   #1
khang0001
LQ Newbie
 
Registered: Sep 2011
Posts: 8

Rep: Reputation: Disabled
i can`t run mysql in chroot, please help me


my os is centos 5.5. and mysql is 5.0.92
i finish config mysql and i must setup mysql in chroot . i do follow in the guild :
compile mysql
Code:
groupadd mysql
useradd -g mysql mysql -d /dev/null -s /sbin/nologin
./configure --prefix=/usr/local/mysql --with-mysqld-user=mysql --with-unix-socket-path=/tmp/mysql.sock --with-mysqld-ldflags=-all-static --without-innodb 
make
make install
strip /usr/local/mysql/libexec/mysqld
scripts/mysql_install_db
chown -R root /usr/local/mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql
cp support-files/my-medium.cnf /etc/my.cnf
chown root:sys /etc/my.cnf
chmod 644 /etc/my.cnf
make folder chroot
Code:
mkdir -p /chroot/mysql/dev
mkdir -p /chroot/mysql/etc
mkdir -p /chroot/mysql/tmp
mkdir -p /chroot/mysql/var/tmp
mkdir -p /chroot/mysql/usr/local/mysql/libexec
mkdir -p /chroot/mysql/usr/local/mysql/share/mysql/english
chown -R root:sys /chroot/mysql
chmod -R 755 /chroot/mysql
chmod 1777 /chroot/mysql/tmp
cp /usr/local/mysql/libexec/mysqld /chroot/mysql/usr/local/mysql/libexec/
cp /usr/local/mysql/share/mysql/english/errmsg.sys /chroot/mysql/usr/local/mysql/share/mysql/english/
cp /etc/hosts /chroot/mysql/etc/
cp /etc/host.conf /chroot/mysql/etc/
cp /etc/resolv.conf /chroot/mysql/etc/
grep mysql /etc/group > /chroot/mysql/etc/group
grep mysql /etc/passwd > /chroot/mysql/etc/passwd
mknod /chroot/mysql/dev/null c 2 2
chown root:sys /chroot/mysql/dev/null
chmod 666 /chroot/mysql/dev/null
copy database mysql
Code:
cp -R /usr/local/mysql/var/ /chroot/mysql/usr/local/mysql/var
chown -R mysql:mysql /chroot/mysql/usr/local/mysql/var
run chroot
Code:
chrootuid /chroot/mysql mysql /usr/local/mysql/libexec/mysqld &
and the result
Code:
mysql     2015  0.0  2.8  31420  3552 pts/0    Sl   09:32   0:00 /usr/local/mysql/libexec/mysqld
root      2023  0.0  0.5   4000   696 pts/0    R+   09:44   0:00 grep mysql
i try to run mysql but it don`t run. the guild is end. what the next step i will do ?
how can i run mysql ?
please help me
 
Old 09-20-2011, 04:36 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
first thing is you might want to upgrade to the ONLY supported version of cent5 -- centOS 5.6 ( soon to be 5.7 )
cent ONLY supports the current version

now i do recommend that people build the apache,mysql,php,... stack a few times so that they LEARN how to set it up and configure it

what "how to" are you fallowing ?
i have only needed to use "chroot" if booting from a rescue disk to fix something

there is a argument for /usr/local

if this is a network install on the machine you are sitting in front of ( and it is a thin client)
if not use /usr

but the normal rhel/cent install would have you install it to /usr

I like to have everything in one place - easier to work with
installing to something like
/usr/opt/www/mysql
/usr/opt/www/apache/http
/usr/opt/www/phpmyadmin

but that is a personal choice
 
Old 09-21-2011, 12:20 AM   #3
khang0001
LQ Newbie
 
Registered: Sep 2011
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by John VV View Post
first thing is you might want to upgrade to the ONLY supported version of cent5 -- centOS 5.6 ( soon to be 5.7 )
cent ONLY supports the current version

now i do recommend that people build the apache,mysql,php,... stack a few times so that they LEARN how to set it up and configure it

what "how to" are you fallowing ?
i have only needed to use "chroot" if booting from a rescue disk to fix something

there is a argument for /usr/local

if this is a network install on the machine you are sitting in front of ( and it is a thin client)
if not use /usr

but the normal rhel/cent install would have you install it to /usr

I like to have everything in one place - easier to work with
installing to something like
/usr/opt/www/mysql
/usr/opt/www/apache/http
/usr/opt/www/phpmyadmin

but that is a personal choice
i understand but i do follow in the guild. if mysql can run, i will build mysql in chroot for myself. but now the guild can`t run. can you help me to make mysql run in chroot
 
Old 09-21-2011, 01:44 AM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
what guide is telling you to use "chroot" and to use
"mkdir -p /chroot/..."

a link would be helpful those commands are a bit odd
Unless you are building on a remote server but still making the folder chroot INSTEAD of issuing the command ???

i take it it is not the mysql web site
http://dev.mysql.com/doc/refman/5.1/...tribution.html


now you are aware that for the current cent 5.7 mysql-5.0.77-4.el5_6.6.i386.rpm is the current version

installing a different version will also require installing DIFFERENT versions of apache php,and anything that depends on it
and the versions of the dependencies in the unsupported 5.5 are even older
So installing 5.0.92 will be difficult


installing a database and everything required for it is NOT recommended on a "end of life" version of cent
it IS RECOMMENDED to upgrade to 5.7 FIRST Then install mysql , and ( i take it phpmyadmin also )
 
  


Reply



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
How to run firefox in a chroot jail? jlangelier Linux - Security 5 07-20-2012 03:24 PM
Configuring MySQL under chroot Env ajayan Linux - Newbie 1 11-02-2010 11:03 PM
MySQL 5.0.67: Unable to install & run. Error /var/lib/mysql/mysql.sock' (2) peteyperson Linux - Server 2 03-04-2009 01:16 PM
chroot to run hd-installed distro's programs from chroot in live distro? silencestone Linux - Software 0 10-12-2007 06:29 AM
run postfix in a chroot environment cccc Debian 4 09-17-2006 07:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:01 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
Open Source Consulting | Domain Registration