Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

backing up users permissions

Status
Not open for further replies.

timgerr

IS-IT--Management
Jan 22, 2004
364
US
I was wondering how I can backup user rights to a database that I have. I am able to create a dump of the database but how can I backup the user rights.

Thank you,
timgerr

-How important does a person have to be before they are considered assissinated instead of just murdered?

 
simply back up the mysql table in the databases directory. That is the table that contains permissions. You can actually migrate that table from one database to another, and the second DB will inherit the permissions.
I do not know what OS you are on, but generally, on a *nix system, the database directory is the var directory in the mysql_home dir. On Red Hat Enterprise Linux, the path to the DB directory is /var/lib/mysql/. I do not know where it is on Windows. BTW, all your databases will be in that directory. You can actually back up databases without doing a DB dump, by just backing up the individual DB directories.
 
I am using a *nix box and was wondering what the extention for the databases are???

Thanks
Timgerr

-How important does a person have to be before they are considered assissinated instead of just murdered?

 
The databases are actually directories. Their names are identical (including case) to what you named your Mysql directories. For example, say you created a database called My_Billing_DB. Do a search for that on your *nix box. You will find a directory matching that name. The contents of that directory will be all the tables within it, also matching the names of your tables. There will be 3 files for each table, with extensions frm, MYI, and MYD. For example, say you had within My_Billing_DB database a table names My_Customers. Then in the My_Billing_DB directory you would find My_Customers.frm, My_Customers.MYD, and My_Customers.MYI. The file with MYD extension contains the actual data residing in the table. The other 2 contain format and layout of the table. By backing up those 3 files, you back up the entire table.
Now look at the parent directory of My_Billing_DB. You will see directories representing your other databases (if any) there. The directories there will match whatever you see when you type SHOW DATABASES at the mysql prompt. One of the directories will be mysql. That is the administrative database that Mysql refers to when deciding permissions. Go into it, and you will see files representing such tables as column_privs, db, user, ... Basically, the tables you would see if you were to do USE MYSQL and SHOW TABLES at the mysql prompt. Just back up this entire mysql database, and you are basically backing up all the tables within it - all your user information and permissions
 
Thank you, I am doing that right now

-How important does a person have to be before they are considered assissinated instead of just murdered?

 
OK I have copied all the data bases over and I an see them with the admin account. The problem is, is that the individual user accounts to the databases did not transfer over from the old computer to the new computer. Any information on what files hold these accounts???


Thank again for your help,
Timgerr


-How important does a person have to be before they are considered assissinated instead of just murdered?

 
did you copy the mysql database as well? there will be an actual database called *mysql* that will hold account information. Copy it over to the new computer, into the appropriate directory (with your other databases) and restart the mysql instance.
 
OK... I did not know that. I did not copy that information over. Thanks

-How important does a person have to be before they are considered assissinated instead of just murdered?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top