Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Having said that, I don't believe you can associate a port number with an individual database inside a running mysqld daemon. A daemon is prepared to listen to one port, and one port only. In order to use multiple ports, you would have to set up multiple daemons, with the associated multiple base & data directories.
Finally, find any *.cnf files in your mysql directories to look at pre-start configuration files. Researching these will give other clues about general and daemon-specific settings.
Indeed, a mysql daemon is associated with one physical database; what you are technically talking about there is multiple schemas (often loosely referred to as databases ...) inside a single physical db.
If you want separate ports, you'll have to install a new copy of mysql for each database...
I had to do this awhile ago actually as part of a muliple master/single slave replication setup. The answer I believe you are looking for is here http://dev.mysql.com/doc/refman/5.0/...qld-multi.html . Mysqld_multi is quite easy to use, though it does take a little practice to get everything going how you expect it too. If you need any help with the implementation, I can probably help you.
Im not exactly sure I understood what you had in mind when you asked your q. You said you wanted to have a SECURITY Feature that can assign ports to each of a database. I do have rather some suggestion.
IF Databases A,B, and C exist on one database server machine,
THEN I have, in my experience, created multiple Database SERVERS on one machine, i compiled mysql 4.0.16 and 5.5.8 on a single machine but prefixed 4___ and 5___ to every configuration on the installation. This means that while the machine is on, Mysql4 and Mysql5 is up, and to access it Mysql4 i used the port 43306. Mysql5 is port 53306. The solution involved compiling the source of the mysql, and prefixing 4 or 5 on all the directories, and even ports.
IF Databases A,B, and C exists on Different machines,
THEN its up to the PHP to connect to each machine. Have different mysql connection handles for each of the server, and connect, just as you would on separate and independent database servers.
I would create classes of database connections which i can reuse.
I am not familiar with mysql proxy, but, maybe with port forwarding, it could work.
I think I get it - the security concern is that user A has access to user B's tables and you don't trust grant statements*...
In which case I would suggest creating virtual machines and place the LAMP's on seperate virtual machines anyway. Installation would be easier and there is no concern that user A could ever elevate permissions and access user B's data.
GRANT ALL ON company_A_db.* TO 'user_A' @ '192.168.1.1' IDENTIFIED BY 'water';