View Single Post
  #1  
Old 13th January 2009, 06:25
pat pat is offline
Junior Member
 
Join Date: Jan 2009
Posts: 9
Thanks: 2
Thanked 3 Times in 2 Posts
Default New DB naming scheme

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
Attached Files
File Type: zip ispconfig_isp_datenbank.lib.php.zip (788 Bytes, 228 views)
Reply With Quote
Sponsored Links