View previous topic :: View next topic |
Author |
Message |
(l)user Guru
Joined: 31 Jan 2004 Posts: 334 Location: Poland
|
Posted: Tue Aug 23, 2005 1:27 am Post subject: chrooting mysql |
|
|
Hello,
Im trying to run mysql in chroot env:
Code: |
sh-3.00# mysqld
050823 3:20:10 Can't start server : Bind on unix socket: Permission denied
050823 3:20:10 Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?
050823 3:20:10 Aborting
050823 3:20:10 mysqld: Shutdown Complete
sh-3.00#
sh-3.00# mysql_install_db
Installing all prepared tables
/usr/sbin/mysqld: Can't read dir of '/tmp/' (Errcode: 13)
050823 3:21:04 /usr/sbin/mysqld: Shutdown Complete
...
|
I think persmision of tmp and /var/run/mysqld are the same like in my root file system were it works. Any ideas why it doesnt work? _________________ Registered Linux user #302020
Gadu Gadu #490092 |
|
Back to top |
|
|
Adwin Tux's lil' helper
Joined: 13 Mar 2005 Posts: 128 Location: Poland
|
Posted: Tue Apr 11, 2006 7:04 pm Post subject: |
|
|
The solution is easy.
1: emerge -C mysql
2: rm -fR /etc/mysql /var/log/mysql /var/run/mysqld /var/lib/mysql /usr/share/mysql
3a: emerge mysql
3b: emerge --config =dev-db/mysql-your-version-rxx
4: userdel mysql
5: groupdel mysql
6: groupadd -g 60 mysql
7: useradd -g mysql -s /bin/false -d /var/lib/mysql -c "mysql" mysql
8: chown mysql:mysql /var/lib/mysql -R
9: chown mysql:mysql /var/run/mysqld -R
10: chown mysql:mysql /var/log/mysql -R
11: chmod 0755 /var/lib/mysql -R
12:chmod 0755 /var/log/mysql -R
13: chmod 0755 /var/run/mysqld -R
14: /etc/init.d/mysql start or follow on screen instructions to set root password.
You're done. |
|
Back to top |
|
|
|