Author Topic: MySQL Manager in CWP not working  (Read 425 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
MySQL Manager in CWP not working
« 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?

Offline
**
Re: MySQL Manager in CWP not working
« Reply #1 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

Offline
*
Re: MySQL Manager in CWP not working
« Reply #2 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

Offline
*
Re: MySQL Manager in CWP not working
« Reply #3 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.

Offline
*
Re: MySQL Manager in CWP not working
« Reply #4 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

Offline
*****
Re: MySQL Manager in CWP not working
« Reply #5 on: October 24, 2024, 12:10:45 PM »
Please use the script to change mysql password

Code: [Select]
]sh /scripts/mysql_pwd_reset[/code

Offline
*
Re: MySQL Manager in CWP not working
« Reply #6 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 !!!

Offline
**
Re: MySQL Manager in CWP not working
« Reply #7 on: October 24, 2024, 09:41:47 PM »
Show output of:
Code: [Select]
php -v
php -m
executed on your server by root.

Offline
*****
Re: MySQL Manager in CWP not working
« Reply #8 on: October 25, 2024, 12:54:23 AM »
How did you upgrade you MariaDB version?

Try running:
Code: [Select]
/scripts/mysql_pwd_reset

Offline
*
Re: MySQL Manager in CWP not working
« Reply #9 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]


Offline
*
Re: MySQL Manager in CWP not working
« Reply #10 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:

Offline
**
Re: MySQL Manager in CWP not working
« Reply #11 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.

Offline
*
Re: MySQL Manager in CWP not working
« Reply #12 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

Offline
*
Re: MySQL Manager in CWP not working
« Reply #13 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.

Offline
*
Re: MySQL Manager in CWP not working
« Reply #14 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: