HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Feature Requests (http://www.howtoforge.com/forums/forumdisplay.php?f=17)
-   -   New DB naming scheme (http://www.howtoforge.com/forums/showthread.php?t=30271)

pat 13th January 2009 06:25

New DB naming scheme
 
1 Attachment(s)
I would prefer if databases and database users where named after the owning domain rather than arbitrary IDs if possible. I did a small hack (patch link below) and haven't had any problems in my basic tests. However, it would be great if someone that is actually familiar with the ISPConfig code base could take a look at it. There might also be some additional characters valid in domain names that need replacement in either database names or user names (point 4 below). I have also kept backward compatibility with the current naming scheme (I actually even use it as a fallback when domain names get to long).

The new naming scheme is as follows:

1) First customer database name = domain name (example.tld)

2) Additional customer databases = domain name + underscore and number (example.tld_2, example_tld3, etc)

3) If a database user name created using rule 1 or 2 above would exceed the 16 character length restriction in MySQL, the old naming scheme using internal IDs are used.

4) Dots are replaced with underscores in database user names since dots are invalid characters in MySQL user names.


Patch against 2.2.29 is attached.


Cheers,
Pat


All times are GMT +2. The time now is 16:09.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.