View previous topic :: View next topic |
Author |
Message |
V0rtex n00b
Joined: 13 Apr 2003 Posts: 71
|
Posted: Sat Dec 16, 2006 1:04 am Post subject: [SOLVED] mysql virtual hosting |
|
|
I am setting up a new server and I realized that mysql now supports the new 'srvdir' use flag. After installing mysql I realized that it put the data directory in /srv/localhost/mysql/datadir/ . I got to thinking about whether because of this it is possible to run eg. multiple mysql daemons with different data directories (ie. one for each virtual host I have). It seems that it would only make sense that this is the case. In my searching, however, I have found nothing on the subject. I cannot seem to find any documentation outlining how to configure mysql this way. I tried many different things including setting up multiple config files, but I can't seem to figure this out. Does anyone have experience doing this or at least have some idea as to how to configure mysql this way? I would be very appreciative for any help in figuring this out, and perhaps I could even write a gentoo-wiki page on the topic.
Last edited by V0rtex on Thu Dec 21, 2006 3:50 am; edited 1 time in total |
|
Back to top |
|
|
Sten Tux's lil' helper
Joined: 12 Dec 2006 Posts: 109 Location: Prague, Czechia, European Union
|
Posted: Sat Dec 16, 2006 1:54 am Post subject: Re: mysql virtual hosting |
|
|
V0rtex wrote: | I am setting up a new server and I realized that mysql now supports the new 'srvdir' use flag. After installing mysql I realized that it put the data directory in /srv/localhost/mysql/datadir/ . I got to thinking about whether because of this it is possible to run eg. multiple mysql daemons with different data directories (ie. one for each virtual host I have). It seems that it would only make sense that this is the case. In my searching, however, I have found nothing on the subject. I cannot seem to find any documentation outlining how to configure mysql this way. I tried many different things including setting up multiple config files, but I can't seem to figure this out. Does anyone have experience doing this or at least have some idea as to how to configure mysql this way? I would be very appreciative for any help in figuring this out, and perhaps I could even write a gentoo-wiki page on the topic. |
Yes, it is possible to run multiple MySQL daemons with different data directories but youâll need to executed them by hand. You can create your own init script that will do this. Youâll need to run them on different ports (or disable using ports and use sockets only). Read manual of âmysqldâ for more info, itâs all there. _________________ You don’t understand, I break things like this!
xor rsi,rsi
lodsb
Segmentation fault |
|
Back to top |
|
|
V0rtex n00b
Joined: 13 Apr 2003 Posts: 71
|
Posted: Sat Dec 16, 2006 3:25 am Post subject: |
|
|
with the current stable version of mysql in portage, I figured out how to get multiple daemons to run on different ports and to use different config files by editing '/etc/conf.d/mysql' but the problem I have is this. With the main data directory I was able to just run Code: | ebuild /var/db/pkg/dev-db/mysql-5.0.26-r1/mysql-5.0.26-r1.ebuild config |
... and I suppose it would get all the default information from the default 'my.cnf' file. It would do a number of things with the data directory such as setting the proper permissions on it and allowing me to set the default root password. I could not, however, figure out if/how it was possible to either make the config script use a different datadir/config file or how to manually set up the databases for each of the virtual hosts. Any ideas on this? |
|
Back to top |
|
|
nixnut Bodhisattva
Joined: 09 Apr 2004 Posts: 10974 Location: the dutch mountains
|
Posted: Sat Dec 16, 2006 12:11 pm Post subject: |
|
|
Moved from Installing Gentoo to Other Things Gentoo.
Not about getting gentoo installed, so moved here. _________________ Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
talk is cheap. supply exceeds demand |
|
Back to top |
|
|
V0rtex n00b
Joined: 13 Apr 2003 Posts: 71
|
Posted: Thu Dec 21, 2006 3:49 am Post subject: |
|
|
After a lot of time and research I finally found a solution to the problem. I have created a wiki page on gentoo-wiki.com that details the steps and process that I used to solve my problem. The HOWTO is found at http://gentoo-wiki.com/HOWTO_Setup_mysql_virtual_hosting . Hopefully someone will find it useful. |
|
Back to top |
|
|
|