New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

MySQL Manager in CWP not working

Started by mabdala68, October 24, 2024, 05:52:06 AM

Previous topic - Next topic

mabdala68

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?

cyberspace

Are you able to connect to MySQL/MariaDB from shell using the login details from the files listed below ?

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

mabdala68


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

mabdala68

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.

mabdala68

/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

josemnunez

Please use the script to change mysql password

]sh /scripts/mysql_pwd_reset[/code

mabdala68

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 !!!

cyberspace

Show output of:

php -v
php -m

executed on your server by root.

Starburst

How did you upgrade you MariaDB version?

Try running:
/scripts/mysql_pwd_reset

mabdala68

[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]


mabdala68


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:

cyberspace

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:

user='mylogin'
password='mypassword'


because some chars (!@#$%^) could be recognized as special chars.

mabdala68

I restore my image disk, and the problem solved, But I still haven't solved the MySQL Manager issue

mabdala68

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.

mabdala68

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: