Control Web Panel

WebPanel => MySQL => Topic started by: mabdala68 on October 24, 2024, 05:52:06 AM

Title: MySQL Manager in CWP not working
Post by: mabdala68 on October 24, 2024, 05:52:06 AM
MySQL Manager in CWP not working issues:
- list of databases is not shown
- can't create new database
- can't create new user


Using... AlmaLinux release 8.10 (Cerulean Leopard) con  10.11.9-MariaDB

Log error : Invalid database response: ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)

root Its OK !

SHOW GRANTS FOR 'root'@'localhost';
+----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost                                                                                                              |
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` IDENTIFIED BY PASSWORD '*111111111111111111111111111111' WITH GRANT OPTION |
| GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION                                                                          |
+----------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.000 sec)

Have an idea ??  I saw https://wiki.centos-webpanel.com/mysql-manager-not-working  , But I don't know what to check or do to fix it.

Most common issues are that you have added invalid config into mysql config files. ??????
You can check this from the command line by using one of the following commands

 mysql --version
mysql  Ver 15.1 Distrib 10.11.9-MariaDB, for Linux (x86_64) using readline 5.1

 mysql -e "show databases;"
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)


For MariaDB which is default with CWP please note that you need to add config into file
/etc/my.cnf.d/server.cnf under [mysqld]  ??????

What should I do?
Title: Re: MySQL Manager in CWP not working
Post by: cyberspace on October 24, 2024, 07:11:54 AM
Are you able to connect to MySQL/MariaDB from shell using the login details from the files listed below ?

Code: [Select]
/usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php
/root/.my.cnf
Title: Re: MySQL Manager in CWP not working
Post by: mabdala68 on October 24, 2024, 11:10:17 AM

cat /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php
<?php

        /* MySQL hostname [ localhost (127.0.0.1 via TCP/IP) ] */
        $db_host = "localhost";

        /* The name of the database */
        $db_name = "root_cwp";

        /* MySQL database username */
        $db_user = "root";

        /* MySQL database password */
        $db_pass = '#Asfe33#frWBVv@';

        //Password used for encryptions (don't change)
        $crypt_pwd = 'gMV6bAeiVBFX';

?>
 cat /root/.my.cnf

[client]
password=#Asfe33#frWBVv@
user=root

Same password. I was able to log in to the MySQL user without any problems
Title: Re: MySQL Manager in CWP not working
Post by: mabdala68 on October 24, 2024, 11:24:54 AM
The passw in  /root/.my.cnf file  hasn't got quotes. Need to insert ?. In another server, where the SQL Manager works well, the password does not have quotes.
Title: Re: MySQL Manager in CWP not working
Post by: mabdala68 on October 24, 2024, 11:28:32 AM
/etc/my.cnf

[mysqld]
performance-schema=0
max_connections=150
max_user_connections=100
query_cache_size=0
skip-external-locking
table_open_cache=2048 
sort_buffer_size=2M   
net_buffer_length=24K 
read_buffer_size=512K 
read_rnd_buffer_size=512K 
innodb_buffer_pool_size=24G 
innodb_file_per_table=1
tmp_table_size=512M 
max_heap_table_size=512M 
thread_cache_size=32
open_files_limit=32961
max_allowed_packet=512M 
log-error=/var/log/mariadb/mariadb.log
sql_mode="NO_ENGINE_SUBSTITUTION"
# InnoDB
innodb_fast_shutdown=1

#
# This group is read both by the client and the server
# use it for options that affect everything
#
[client-server]

#
# include *.cnf from the config directory
#
!includedir /etc/my.cnf.d
Title: Re: MySQL Manager in CWP not working
Post by: josemnunez on October 24, 2024, 12:10:45 PM
Please use the script to change mysql password

Code: [Select]
]sh /scripts/mysql_pwd_reset[/code
Title: Re: MySQL Manager in CWP not working
Post by: mabdala68 on October 24, 2024, 07:40:30 PM
I applied the script :  sh /scripts/mysql_pwd_reset , changed the password, reset the VPS, but the problem persists.

Anything else to do that I might not have understood?

THNXSS !!!
Title: Re: MySQL Manager in CWP not working
Post by: cyberspace on October 24, 2024, 09:41:47 PM
Show output of:
Code: [Select]
php -v
php -m
executed on your server by root.
Title: Re: MySQL Manager in CWP not working
Post by: Starburst on October 25, 2024, 12:54:23 AM
How did you upgrade you MariaDB version?

Try running:
Code: [Select]
/scripts/mysql_pwd_reset
Title: Re: MySQL Manager in CWP not working
Post by: mabdala68 on October 28, 2024, 10:17:07 AM
[root@xxxaza~]# php -v
PHP 8.2.24 (cli) (built: Oct 11 2024 15:09:22) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.24, Copyright (c) Zend Technologies
[root@xxxaza~]# php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imagick
imap
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
pspell
random
Reflection
session
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
xml
xmlreader
xmlwriter
xsl
zip
zlib

[Zend Modules]

Title: Re: MySQL Manager in CWP not working
Post by: mabdala68 on October 28, 2024, 11:00:02 AM

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0

Trying to start mysql server, please wait!
Try to restart Control Web Panel with command: sh /scripts/restart_cwpsrv

**Check your MySQL root password in: /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php and /root/.my.cnf
You can reset the MySQL root password fast with this command: /scripts/mysql_pwd_reset -q


Warning: mysqli_error() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0
Could not connect:
Title: Re: MySQL Manager in CWP not working
Post by: cyberspace on October 28, 2024, 05:57:43 PM
PHP outrput looks good. Try to reset the root password anyway and then update the password in:

/root/.my.cnf
/usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php


Additionally, make sure the login and password inside the file /root/.my.cnf is quoted by single quotas like:
Code: [Select]
user='mylogin'
password='mypassword'

because some chars (!@#$%^) could be recognized as special chars.
Title: Re: MySQL Manager in CWP not working
Post by: mabdala68 on October 28, 2024, 06:12:43 PM
I restore my image disk, and the problem solved, But I still haven't solved the MySQL Manager issue
Title: Re: MySQL Manager in CWP not working
Post by: mabdala68 on October 28, 2024, 06:18:56 PM
I don't know where else to check, whether to delete the MySQL configuration, review a MySQL database, I can't think of how to proceed.
Title: Re: MySQL Manager in CWP not working
Post by: mabdala68 on October 28, 2024, 06:29:36 PM
Now, my MySQL config is empty. When I insert the previous configuration, the system shows the following error ::::


Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0

Trying to start mysql server, please wait!
Try to restart Control Web Panel with command: sh /scripts/restart_cwpsrv

**Check your MySQL root password in: /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php and /root/.my.cnf
You can reset the MySQL root password fast with this command: /scripts/mysql_pwd_reset -q


Warning: mysqli_error() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0
Could not connect:
Title: Re: MySQL Manager in CWP not working
Post by: Starburst on October 28, 2024, 07:15:14 PM
What do you get when you run:
Code: [Select]
mysql -V
Please post it here.
Title: Re: MySQL Manager in CWP not working
Post by: mabdala68 on October 28, 2024, 07:23:47 PM
mysql -V
mysql  Ver 15.1 Distrib 10.11.9-MariaDB, for Linux (x86_64) using readline 5.1
Title: Re: MySQL Manager in CWP not working
Post by: Starburst on October 28, 2024, 07:52:00 PM
Try running:
Code: [Select]
mysql_upgrade --force
Then:
Code: [Select]
sh /scripts/mysql_fix_myisam_tables

If that fails, reimage it to the basic AlmaLinux 9.4, and leave it.
Sen me a PM with the IP & root PW, and I'll login and get the system installed and updated (No I'm not going to charge)
Title: Re: MySQL Manager in CWP not working
Post by: mabdala68 on October 28, 2024, 08:07:27 PM
 mysql_upgrade --force
Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
FATAL ERROR: Upgrade failed
Title: Re: MySQL Manager in CWP not working
Post by: Starburst on October 28, 2024, 08:19:47 PM
Since you have client data already, the only thing I could suggest if to open a paid support ticket with CWP, it's $7.49 for a one-time support, and see if they might be able to login and fix whatever has gotten corrupted at this point.

Here is the link:
https://support.centos-webpanel.com/index.php?rp=/store/support-onetime (https://support.centos-webpanel.com/index.php?rp=/store/support-onetime)

Hopefully they might be able to get it sorted out for you.
Title: Re: MySQL Manager in CWP not working
Post by: cyberspace on October 28, 2024, 11:18:32 PM
Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
FATAL ERROR: Upgrade failed

Run:

Code: [Select]
ls -ld /var/lib/mysql
ls -l /var/lib/mysql

in shell as root and show output.

Anyway, it doesn't look like CWP problem.

Moreover, to update the database of MariaDB 10.6+ the following command must be executed:

Code: [Select]
mariadb-upgrade
Run it and look for result.