Author Topic: Help restore rouncube mysql.  (Read 365 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Help restore rouncube mysql.
« on: March 03, 2025, 02:10:36 PM »
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.

Offline
*****
Re: Help restore rouncube mysql.
« Reply #1 on: March 03, 2025, 02:34:11 PM »
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?

Offline
*
Re: Help restore rouncube mysql.
« Reply #2 on: March 03, 2025, 02:43:00 PM »
 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.

Offline
*
Re: Help restore rouncube mysql.
« Reply #3 on: March 03, 2025, 02:45:53 PM »
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.

Offline
*
Re: Help restore rouncube mysql.
« Reply #4 on: March 03, 2025, 02:52:55 PM »
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.

Offline
*
Re: Help restore rouncube mysql.
« Reply #5 on: March 03, 2025, 03:45:33 PM »
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]#

Offline
*
Re: Help restore rouncube mysql.
« Reply #6 on: March 03, 2025, 03:46:55 PM »
And my every website stopp working :(

Offline
*
Re: Help restore rouncube mysql.
« Reply #7 on: March 03, 2025, 04:19:01 PM »
And my every website stopp working :(

Website fixed.

Offline
*
Re: Help restore rouncube mysql.
« Reply #8 on: March 03, 2025, 04:34:46 PM »
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.
« Last Edit: March 03, 2025, 04:50:09 PM by Kvakunoff »

Offline
*
Re: Help restore rouncube mysql.
« Reply #9 on: March 03, 2025, 04:38:21 PM »
This line is on roundcube config file.
$config['db_dsnw'] = 'mysql://ridha_roun288:9pS750@6(g@localhost/ridha_roun288';


Offline
*****
Re: Help restore rouncube mysql.
« Reply #10 on: March 03, 2025, 04:52:50 PM »

Offline
*
Re: Help restore rouncube mysql.
« Reply #11 on: March 03, 2025, 05:25:45 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.


Offline
*
Re: Help restore rouncube mysql.
« Reply #12 on: March 03, 2025, 07:04:10 PM »
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.

Offline
*****
Re: Help restore rouncube mysql.
« Reply #13 on: March 03, 2025, 08:44:45 PM »
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.