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 ›

Help restore rouncube mysql.

Started by Kvakunoff, March 03, 2025, 02:10:36 PM

Previous topic - Next topic

Kvakunoff

Hello,
i made huge mistake deleting roundcube mysql.
I have backup, but not allow me to do it.
I did try with phpmyadmin, the database is restored, but cannot connect for some reason.
DATABASE ERROR!
Unable to connect to the database!
Please contact your server-administrator.
I did try to reinstall roundcube and got this error.
Running update script at target...
Executing database schema update.
ERROR: SQLSTATE[HY000] [1045] Access denied for user 'ridha_roun288'@'localhost' (using password: YES)
ERROR: Failed to connect to database
All done.
[root@server roundcubemail-1.5.8]#

Please help.

overseer

Roundcube initialization DB is available here:
https://github.com/roundcube/roundcubemail/blob/master/SQL/mysql.initial.sql
You can load it in via the CLI mariadb client, or with phpMyAdmin.

But it seems more to be a permissions problem based on your error. Have you updated your config to reflect the correct username, password -- DB credentials?

Kvakunoff

 Import has been successfully finished, 21 queries executed. (mysql.initial.sql)
Error

SQL query: Copy

-- Table structure for table `session`

CREATE TABLE `session` (
`sess_id` varchar(128) NOT NULL,
`changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`ip` varchar(40) NOT NULL,
`vars` mediumtext NOT NULL,
PRIMARY KEY(`sess_id`),
INDEX `changed_index` (`changed`)
) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

MySQL said: Documentation
#1046 - No database selected

That is with phpmyadmin.

Kvakunoff

Have you updated your config to reflect the correct username, password -- DB credentials? -

I have not.
I uploaded just database. When uploaded original database  there was no error on ridha_roun288

Haven't touch anything.

Kvakunoff

The thing i, this is a database name -> ridha_roun288 not an user.
Or maybe initial install create this user with same name as the database.

Kvakunoff

I used curl -s -L https://www.alphagnu.com/upload/tmp/cwp_rc_fix_remove.sh | bash
Then i did try install roundcube again.
Now its even worst.

[root@server src]# tar xf roundcubemail-1.5.8-complete.tar.gz
[root@server src]# cd  roundcubemail-1.5.8
[root@server roundcubemail-1.5.8]# sed -i "s@\/usr\/bin\/env php@\/usr\/bin\/env \/usr\/local\/cwp\/php71\/bin\/php@g" /usr/local/src/roundcubemail-1.5.8/bin/installto.sh
[root@server roundcubemail-1.5.8]# sed -i "s@\php bin@\/usr\/local\/cwp\/php71\/bin\/php bin@g" /usr/local/src/roundcubemail-1.5.8/bin/installto.sh
[root@server roundcubemail-1.5.8]# bin/installto.sh /usr/local/cwpsrv/var/services/roundcube
PHP Warning:  PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/local/cwp/php71/lib/php/extensions/no-debug-non-zts-20170718/intl (/usr/local/cwp/php71/lib/php/extensions/no-debug-non-zts-20170718/intl: cannot open shared object file: No such file or directory), /usr/local/cwp/php71/lib/php/extensions/no-debug-non-zts-20170718/intl.so (libicui18n.so.50: cannot open shared object file: No such file or directory)) in Unknown on line 0
Target installation already in version 1.5.8. Do you want to update again? (y/N)
y
Copying files to target location..../
installto.sh
.htaccess.new
done.

NOTICE: New .htaccess file saved as .htaccess.new.

Running update script at target...
PHP Warning:  PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/local/cwp/php71/lib/php/extensions/no-debug-non-zts-20170718/intl (/usr/local/cwp/php71/lib/php/extensions/no-debug-non-zts-20170718/intl: cannot open shared object file: No such file or directory), /usr/local/cwp/php71/lib/php/extensions/no-debug-non-zts-20170718/intl.so (libicui18n.so.50: cannot open shared object file: No such file or directory)) in Unknown on line 0
Executing database schema update.
ERROR: SQLSTATE[HY000] [1045] Access denied for user 'ridha_roun288'@'localhost' (using password: YES)
ERROR: Failed to connect to database
All done.
[root@server roundcubemail-1.5.8]#

Kvakunoff

And my every website stopp working :(

Kvakunoff


Kvakunoff

#8
There was no user added to this database.
https://gyazo.com/c90e7a3a93fcb559b0438e1e88f68505

I added user ridha_roun288 to this database, but it set a new password.
So can at least someone tell me where to set the new password in a propper way ?
It may be a solution.

Kvakunoff

This line is on roundcube config file.
$config['db_dsnw'] = 'mysql://ridha_roun288:9pS750@6(g@localhost/ridha_roun288';



Kvakunoff

Quote from: overseer on March 03, 2025, 04:52:50 PM
https://www.alphagnu.com/topic/33-update-cwp-roundcube-mail-version-158-%E2%80%93-control-web-panel/
(change to 1.5.9, current CWP compatible LTS version)

Thank you for trying to help me.
I did what you said and not working.
My only option is now to restore databases and files.


Kvakunoff

It was a 5 seconds fix.

I just change the new database password with the old i copy it from the $config['db_dsnw'],.
So simple solution.

overseer

Yes indeed, simple fix as they usually are, once you look in the right place.
That Alphagnu link for 1.5.9 was for after the fact, once you got it working. It will bring it to latest LTS version that works with CWP.