Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-04-28, 23:37:38

Author Topic: Why there is prefix instead of username inside databases ?  (Read 6233 times)

0 Members and 1 Guest are viewing this topic.

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
It makes stuff even more complicated !

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Why there is prefix instead of username inside databases ?
« Reply #1 on: 2014-02-22, 03:51:19 »
Click help. Username is cutoff of databasename.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Why there is prefix instead of username inside databases ?
« Reply #2 on: 2014-02-22, 11:36:35 »
Click help. Username is cutoff of databasename.

This makes even more complicated to move customer databases beetween servers.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Why there is prefix instead of username inside databases ?
« Reply #3 on: 2014-02-22, 12:37:54 »
It's for new database. I think it's better compare to 'tester_wp', especially for changeowner.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Why there is prefix instead of username inside databases ?
« Reply #4 on: 2014-02-22, 18:04:04 »
It's for new database. I think it's better compare to 'tester_wp', especially for changeowner.

With usernames we are able to move customer databases manually from /var/lib/mysql. Now we have to move them manually checking each name :/

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Why there is prefix instead of username inside databases ?
« Reply #5 on: 2014-02-22, 23:47:43 »
Why move with manually. Why not using change owner?.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Kloxo-DR

  • Senior Member
  • *
  • Posts: 239
  • Karma: +3/-9
    • View Profile
Re: Why there is prefix instead of username inside databases ?
« Reply #6 on: 2014-02-23, 07:59:29 »
Hui Mustafa,

Why move with manually. Why not using change owner?.

By changing owner, - until the change from official - kloxo did not enter all details in mysql database in grant tables. I must admit that I do not know if this was modified or eradicated in the later versions of official kloxo. So I do not know about Kloxo-MR.

I would better suggest to have a /script/changeowner and /script/fix-owner.

This would help from the command line as well as kloxomr could use it as well.

Apart from that, I would love to see a feature Admin Home ---> Fix-Home : under Admin. We have many fix scripts. One could have a webpage for that.

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Why there is prefix instead of username inside databases ?
« Reply #7 on: 2014-02-23, 21:07:50 »
Sometimes there is a need to move multiple databases between servers. Doing this manually takes too much time. If we really need to move then we just copy entries inside Kloxo database then just move databases by coping it.

Cpanel is using names like u2467192_news, u2467192_games etc. Why not use them ?

Also we've got some install scripts that were using Kloxo to add databases.

The worst thing is that when we look a customers overusing our MySQL server by installing some crappy PHP scripts. 

In the past it was easy we can just see which processes where used and username was there. Now it's gone. We have to check each database and check which customer it belongs too. Too much work and completely pointless change !

Another example - when removing customer, if something happens ex. script freeze, server reboot etc. and it didn't remove client completely we still that customer databases are on disk so we can manually remove them. Now we don't know which databases were belonging to that removed customer so we need to check one by one. Horrible work !
« Last Edit: 2014-02-23, 21:14:32 by Spacedust »

Offline insanity

  • Senior Member
  • *
  • Posts: 215
  • Karma: +0/-0
    • View Profile
Re: Why there is prefix instead of username inside databases ?
« Reply #8 on: 2014-02-24, 00:56:57 »
Spacedust if this is a problem for you, the solution is simple. Back kloxo to normal db struct.

Find in: /usr/local/lxlabs/kloxo/httpdocs/driver/pserver/ddatabaselib.php line 63 to 69
Code: [Select]
/*
if (!$parent->isAdmin()) {
$param['nname'] = self::getDbName($parent->nname, $param['nname']);
} else {
$param['nname'] = substr($param['nname'], 0, 15);
}
*/
and change it to:
Code: [Select]
if (!$parent->isAdmin()) {
$param['nname'] = self::getDbName($parent->nname, $param['nname']);
} else {
$param['nname'] = substr($param['nname'], 0, 15);
}

Find line 72:
Code: [Select]
$param['nname'] = random_string_lcase(4) . "_" . $param['nname'];
and change it to:
Code: [Select]
//$param['nname'] = random_string_lcase(4) . "_" . $param['nname'];
then find:
Code: [Select]
// if (!$parent->isAdmin()) {
// $dbprefix = self::fixDbname($parent->nname);
// }

// $vlist['nname'] = array('m', array('pretext' => $dbprefix));
$vlist['nname'] = array('m', array('pretext' => 'prefix_'));
// $vlist['dbtype'] = $class;
and change it to:
Code: [Select]
if (!$parent->isAdmin()) {
$dbprefix = self::fixDbname($parent->nname);
}

$vlist['nname'] = array('m', array('pretext' => $dbprefix));
// $vlist['nname'] = array('m', array('pretext' => 'prefix_'));
// $vlist['dbtype'] = $class;

As i see now kloxo add random generated databases for exampe UHahqd9_dbname ( like cpanel )

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Why there is prefix instead of username inside databases ?
« Reply #9 on: 2014-02-24, 12:26:59 »
Spacedust if this is a problem for you, the solution is simple. Back kloxo to normal db struct.

Find in: /usr/local/lxlabs/kloxo/httpdocs/driver/pserver/ddatabaselib.php line 63 to 69
Code: [Select]
/*
if (!$parent->isAdmin()) {
$param['nname'] = self::getDbName($parent->nname, $param['nname']);
} else {
$param['nname'] = substr($param['nname'], 0, 15);
}
*/
and change it to:
Code: [Select]
if (!$parent->isAdmin()) {
$param['nname'] = self::getDbName($parent->nname, $param['nname']);
} else {
$param['nname'] = substr($param['nname'], 0, 15);
}

Find line 72:
Code: [Select]
$param['nname'] = random_string_lcase(4) . "_" . $param['nname'];
and change it to:
Code: [Select]
//$param['nname'] = random_string_lcase(4) . "_" . $param['nname'];
then find:
Code: [Select]
// if (!$parent->isAdmin()) {
// $dbprefix = self::fixDbname($parent->nname);
// }

// $vlist['nname'] = array('m', array('pretext' => $dbprefix));
$vlist['nname'] = array('m', array('pretext' => 'prefix_'));
// $vlist['dbtype'] = $class;
and change it to:
Code: [Select]
if (!$parent->isAdmin()) {
$dbprefix = self::fixDbname($parent->nname);
}

$vlist['nname'] = array('m', array('pretext' => $dbprefix));
// $vlist['nname'] = array('m', array('pretext' => 'prefix_'));
// $vlist['dbtype'] = $class;

As i see now kloxo add random generated databases for exampe UHahqd9_dbname ( like cpanel )

I will leave it as is but that something unusual I think. It might cause some troubles when couting the quota too, but Kloxo should handle this well.

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Why there is prefix instead of username inside databases ?
« Reply #10 on: 2014-03-03, 20:00:36 »
I've changed my mind. This is making so big mess on our servers we are unable to identify properly which databases belongs to which customer. Remember all databases have mysql owner !

This might also cause amazing troubles when counting quota for customers !

How to change this in latest upload ???
« Last Edit: 2014-03-03, 20:05:37 by Spacedust »

 


Top 4 Global Search Engines:    Google    Bing    Baidu    Yahoo
Click Here

Page created in 0.032 seconds with 19 queries.

web stats analysis