PDA

View Full Version : Where are all the databases?


OOagent137
2003-07-31, 14:14 PM
If I were to create a database, where would it be stored? And, could I just copy the database from one server to another and have it work the same way? (Like, there is no server specific info in a database). Thanks.

Tino Didriksen
2003-07-31, 14:21 PM
Try looking in /var/lib/mysql

And yes, you should be able to move a database without problems.

OOagent137
2003-07-31, 17:25 PM
I looked and sure enough, they are all there. I'm curious though, how would I associate a database with a specific account? I mean, all the servers databases are in there, how does the server know what database goes to what account?

Tino Didriksen
2003-07-31, 17:39 PM
That's handled by the privileges set in the main database 'mysql'.

datavortex
2003-07-31, 20:38 PM
mysql accounts are generally seperate from /etc/passwd accounts. If you want to link them together and resell packages with FTP, mail, and mysql virtual accounts, for example, then your question is very complex, as is the solution. Read this (http://www.oreilly.com/catalog/msql2/).

OOagent137
2003-08-01, 18:22 PM
I'll get more specific. I have a site on the server that has a database. I want that database to work on this other site. How can I do that?

awsolutions
2003-08-01, 22:17 PM
If the other site is hosted on the same box just use the same mysql settings.

Your script probably has a config area for a server, name, and password. Since it is on the same server it has no difference what web site accesses the mysql database as long as all website scripts have the same username and password set up.

OOagent137
2003-08-02, 03:36 AM
That makes sense.

In Plesk though, when you click on databases, it would still show up under the old account. I want the new account to be able to administer it. How could I do that?

awsolutions
2003-08-02, 09:26 AM
Hello,

Well, if you are using plesk, only one account can administer it through the CP.

Your options are as follows:

1.) Grant shell access to the other users and allow them to modify it via SSH (SECURITY RISK).

2.) If you just want to move the DB to another account then creat a backup sql file in shell and remove the domain from the control panel, and recreate it in the correct domain and then import the backup sql file restoring it exactly the way it was.

3.) If you want the database to show up in multiple cp's so multiple domain users can modify it (I have no idea why you would want this) but I guess if you fooled around with the plesk database you could get it to show up properly. You would probably just have to add another paramater to one of the tables linking that DB to the correct client ID.

If you want number 2 let me know and I will explain that in detail.

Also, I am assuming this is your server (root access.)

-Brian

awsolutions
2003-08-02, 09:39 AM
Hey,

Since you are using plesk, you should post into the plesk support section not red hat since someone might give you "red hat" help that could wind up breaking plesk, all because they assumed you were using a soley red hat box.

OOagent137
2003-08-03, 00:15 AM
I started this topic over here:
http://www.serverbeach.com/forums/showthread.php?s=&threadid=164