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. 2020-01-27, 19:34:58

Author Topic: Database Admin Missing  (Read 1710 times)

0 Members and 1 Guest are viewing this topic.

Offline Mansoor

  • Junior Member
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Database Admin Missing
« on: 2019-11-12, 19:18:02 »
i've installed kloxo-mr7 on Centos 6.9
i had problem with Mysql from start & tested almost any solution provided in forum & other tutorials i've found over internet. BTW i'm using mariadb, once i've switched to mysql but sadly lost even access to kloxo admin panel
So reverted back to mariadb.
After several things i've tried in forum, with entering command below, i've lost admin users of mysql too and now IDk how to fix this one.
Code: [Select]
mysqld --skip-grant-tables --user=mysql,
This is output of sysinfo script is just like below:

Code: [Select]
A. Control Panel:               
   - Kloxo-MR: 7.0.0.c-2019070501
   - Web: hiawatha-10.9.0-f.2.mr.el6.x86_64
   - PHP: php56s - 5.6.40-1.ius.el6 (fpm mode)
B. Plateform:
   - OS: CentOS release 6.10 (Final) x86_64
   - Hostname: vm1105591707.bitcommand.com
C. Services:
   1. MySQL: MariaDB-server-10.0.38-1.el6.x86_64
   2. PHP:
      - Installed:
        - Branch: php71u-cli-7.1.33-1.el6.ius.x86_64
        - Multiple:
          * php52m - 5.2.17-102.mr.el6
          * php53m - 5.3.29-1.ius.el6
          * php54m - 5.4.45-1.ius.el6
          * php55m - 5.5.38-1.ius.el6
          * php56m - 5.6.40-1.ius.el6
          * php70m - 7.0.33-1.ius.el6
          * php71m - 7.1.33-1.el6.ius
      - Used: --PHP Branch--
      - Multiple: disable
   3. Web Used: apache
     - Hiawatha: hiawatha-10.9.0-f.2.mr.el6.x86_64
     - Lighttpd: lighttpd-1.4.47-2.el6.x86_64
     - Nginx: nginx-1.17.5-1.el6.ngx.x86_64
     - Apache: httpd24u-2.4.41-1.el6.ius.x86_64
       - PHP Type: php-fpm_event
       - Secondary PHP: off
   4. WebCache: none
     - ATS: --uninstalled--
     - Squid: --uninstalled--
     - Varnish: --uninstalled--
   5. Dns: djbdns
     - Bind: bind-9.9.9-1.mr.el6.x86_64
     - DJBDns: djbdns-1.05-17.4.mr.el6.x86_64
     - NSD: nsd-4.2.2-1.el6.x86_64
     - PowerDNS: pdns-4.1.8-1.el6.MIND.x86_64
     - Yadifa: yadifa-2.2.5-1.mr.el6.x86_64
   6. Mail: qmail-toaster-1.03-1.3.57.mr.el6.x86_64
      - pop3/imap4: courier-imap-toaster-4.1.2-1.3.20.mr.el6.x86_64
      - smtp: qmail-toaster-1.03-1.3.57.mr.el6.x86_64
      - spam: bogofilter-1.2.4-1.el6.x86_64
   7. FTP: pure-ftpd
      - pure-ftpd: pure-ftpd-1.0.49-1.mr.el6.x86_64
   8. Stats: awstats
      - awstats: kloxomr-stats-awstats-7.7-1.mr.noarch
D. Memory:
             total       used       free     shared    buffers     cached
Mem:          2005        754       1251          0         43        379
-/+ buffers/cache:        331       1674
Swap:         4575          0       4575
E. Disk Space:
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                      143G  4.4G  131G   4% /


*** Process Time: 00:00:00:45.45146 (dd:hh:mm:ss:xxxxxx) ***

* Note: run 'sh /script/sysinfo -y' if you want run 'fix-service-list' also
        (importance after Kloxo-MR update)

Offline Mansoor

  • Junior Member
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Database Admin Missing
« Reply #1 on: 2019-11-12, 19:38:37 »
BTW this is output of reset-mysql-root-password script:

Code: [Select]
# sh /script/reset-mysql-root-password
Stop MySQL service...
MySQL ROOT password reset...
Start MySQL service...
191112 13:35:41 mysqld_safe A mysqld process already exists
Connect failed: Access denied for user 'root'@'localhost' (using password: YES)
[1]+  Done                    mysqld_safe --skip-grant-tables

Online MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-10
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Database Admin Missing
« Reply #2 on: 2019-11-13, 11:27:28 »
Change the content of '/usr/local/lxlabs/kloxo/bin/common/misc/reset-mysql-root-password.php' to:
Code: [Select]
<?php 

include_once "lib/html/include.php";

$tpath "/usr/local/lxlabs/kloxo/serverfile";

if (isset(
$argv[1])) {
$pass $argv[1];
} else {
$pass randomString(9);
}

$text = <<<EOF
UPDATE mysql.user SET Password=PASSWORD('PASSWORD') WHERE User='USER';
FLUSH PRIVILEGES;
EOF;

$text str_replace("'USER'""'root'"$text);
$text str_replace("'PASSWORD'""'{$pass}'"$text);

file_put_contents("{$tpath}/reset-mysql-password.sql"$text);

print(
"Stop MySQL service...\n");
if (
isServiceExists('mysqld')) {
exec("service mysqld stop");
} else {
exec("service mysql stop");
}

print(
"MySQL ROOT password reset...\n");
sleep(10);
system("mysqld_safe --skip-grant-tables --init-file={$tpath}/reset-mysql-password.sql >/dev/null 2>&1 &");
sleep(15);

// MR -- need restart because need stop mysqld_safe before
print("Restart MySQL service...\n");
if (
isServiceExists('mysqld')) {
exec("service mysqld restart");
} else {
exec("service mysql restart");
}

exec("'rm' -f {$tpath}/reset-mysql-password.sql");

print(
"- Test Connecting:\n");

if (
$conn->connect_errno) {
print("  * Failed to connect to MySQL: " $conn->connect_error "\n");
log_error($conn->connect_error);
} else {
print("  * Success\n");
}

print(
"- Save to 'dbadmin' in slavedb\n");
$a['mysql']['dbpassword'] = $pass;
slave_save_db("dbadmin"$a);

/*
$text2 = <<<EOF
REPLACE INTO dbadmin (nname, parent_clname, parent_cmlist, dbtype, dbadmin_name, dbpassword, syncserver, oldsyncserver, olddeleteflag) VALUES
('mysql___localhost', 'pserver-localhost', '', 'mysql', 'root', 'PASSWORD', 'localhost', '', '');
COMMIT;
EOF;
*/

if (!empty(mysql_fetch_array(mysql_query("SHOW DATABASES LIKE '$dbname' ")))) {
$text2 = <<<EOF
UPDATE dbadmin SET dbpassword='PASSWORD' WHERE nname='mysql___localhost' AND dbtype='mysql' AND dbadmin_name='root';
COMMIT;
EOF;

$text2 str_replace("'PASSWORD'""'{$pass}'"$text2);

print("- Update to 'dbadmin' in 'kloxo' database\n");
exec("mysql -u root -p'{$pass}' kloxo -e \"{$text2}\"");
}

$conn->close();

and then try again 'sh /script/reset-mysql-root-password'
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline xamer

  • Valuable Member
  • *
  • Posts: 61
  • Karma: +0/-0
    • View Profile
Re: Database Admin Missing
« Reply #3 on: 2019-12-08, 13:41:00 »
It helped.
Thank you

 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix
Click Here

Page created in 0.035 seconds with 22 queries.

web stats analysis