Nội dung
What is Roundcube?
Roundcube is a free webmail service with basic features and utilities (send/receive/signature…), enough to meet the needs of most users today. With the strong development of Roundcube today, most of these services have been trusted and integrated into the most popular control panels such as cPanel, DirectAdmin, Plesk… With Roundcube, you can quickly create an email address with the following website address, individual, organization or business, extremely simple and completely free.
In this article, I will briefly introduce Roundcube and show you how to handle a Roundcube error that I recently encountered. On a beautiful day, as always, I access Roundcube’s webmail on DirectAdmin to send/receive mail and receive an alert, as shown below. What is this error and how to fix it?
First, you need to determine what account you are using. If you are using DirectAdmin with reseller and sub-user rights, please quickly contact the server administrator for support in checking and processing because this error-handling operation requires SSH into the server and is done at the user root (the user with the highest privileges on the server).
However, if you are the administrator and hold the root Server information, you can actively handle it by following the steps below.
Implementation guide
Step 1: SSH into VPS
First, you need to SSH into your VPS as root, if you don’t know how to SSH, you can refer to the instructions below:
Step 2: Check the Roundcube log
To check the Roundcube log, you need to check at the following path:
tail /var/www/html/roundcube/logs/errror.log
Command annotation:
- Read the log file and print the last 10 lines of the log
In my case, the log returns the following error, with this log, the system reports that Database Roundcube has failed.
[08-Oct-2020 12:18:56 +0100]: DB Error: SQLSTATE[HY000] [1045] Access denied for user 'da_roundcube'@'localhost' (using password: YES) in /var/www/html/roundcubemail-1.4.8/program/lib/Roundcube/rcube_db.php on line 175 (GET /roundcube/) [08-Oct-2020 12:18:56 +0100]: DB Error: SQLSTATE[HY000] [1045] Access denied for user 'da_roundcube'@'localhost' (using password: YES) (GET /roundcube/) [08-Oct-2020 12:19:13 +0100]: DB Error: SQLSTATE[HY000] [1045] Access denied for user 'da_roundcube'@'localhost' (using password: YES) in /var/www/html/roundcubemail-1.4.8/program/lib/Roundcube/rcube_db.php on line 175 (GET /roundcube/) [08-Oct-2020 12:19:13 +0100]: DB Error: SQLSTATE[HY000] [1045] Access denied for user 'da_roundcube'@'localhost' (using password: YES) (GET /roundcube/) [08-Oct-2020 12:21:03 +0100]: DB Error: SQLSTATE[HY000] [1045] Access denied for user 'da_roundcube'@'localhost' (using password: YES) in /var/www/html/roundcubemail-1.4.8/program/lib/Roundcube/rcube_db.php on line 175 (GET /roundcube/) [08-Oct-2020 12:21:03 +0100]: DB Error: SQLSTATE[HY000] [1045] Access denied for user 'da_roundcube'@'localhost' (using password: YES) (GET /roundcube/) [08-Oct-2020 12:31:28 +0100]: DB Error: SQLSTATE[HY000] [1045] Access denied for user 'da_roundcube'@'localhost' (using password: YES) in /var/www/html/roundcubemail-1.4.8/program/lib/Roundcube/rcube_db.php on line 175 (GET /roundcube/) [08-Oct-2020 12:31:28 +0100]: DB Error: SQLSTATE[HY000] [1045] Access denied for user 'da_roundcube'@'localhost' (using password: YES) (GET /roundcube/) [08-Oct-2020 12:41:42 +0100]: DB Error: SQLSTATE[HY000] [1045] Access denied for user 'da_roundcube'@'localhost' (using password: YES) in /var/www/html/roundcubemail-1.4.8/program/lib/Roundcube/rcube_db.php on line 175 (GET /roundcube/) [08-Oct-2020 12:41:42 +0100]: DB Error: SQLSTATE[HY000] [1045] Access denied for user 'da_roundcube'@'localhost' (using password: YES) (GET /roundcube/)
In this case, you should reinstall Roundcube webmail to handle the error.
Step 3: Reinstall Roundcube
To reinstall Roundcube, execute the following commands in turn:
cat /usr/local/directadmin/conf/mysql.conf mysql -u da_admin -p DROP DATABASE da_roundcube; quit cd /usr/local/directadmin/custombuild ./build roundcube
Command annotation:
- Open and show the content of the mysql.conf file (the screen will show the user/password of the Mysql admin user on DirectAdmin)
- Login to Mysql admin (login according to the information shown in command 1)
- Delete Database da_roundcube and quit
- Move to the custombuild folder
- Run the command to rebuild Roundcube
The whole process of executing the command and rebuilding it will look like the below:
[root@sv public_html]# cat /usr/local/directadmin/conf/mysql.conf user=da_admin passwd=IOfBYSiv6n [root@sv public_html]# mysql -u da_admin -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 252981 Server version: 10.2.32-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> DROP DATABASE da_roundcube; Query OK, 14 rows affected (0.04 sec) MariaDB [(none)]> quit Bye [root@sv public_html]# cd /usr/local/directadmin/custombuild [root@sv custombuild]# ./build roundcube Inserting data to mysql and creating database/user for roundcube... Found MySQL version 10.2 Creating User: CREATE USER 'da_roundcube'@'localhost' IDENTIFIED BY 'PPoQQSvIMrCKDO'; Granting access: GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,LOCK TABLES,INDEX,REFERENCES ON da_roundcube.* TO 'da_roundcube'@'localhost'; Setting password: SET PASSWORD FOR 'da_roundcube'@'localhost' = PASSWORD('PPoQQSvIMrCKDO'); Database created, da_roundcube password is PPoQQSvIMrCKDO Editing roundcube configuration... Roundcube 1.4.8 has been installed successfully. WARNING: Changed defaults (These config options have new default values): - 'skin' - 'smtp_port' - 'smtp_user' - 'smtp_pass' - 'jquery_ui_skin_map' Executing database schema update. NOTICE: Update dependencies by running `php composer.phar update --no-dev` done. This instance of Roundcube is up-to-date. Have fun! Reloading php-fpm56. Reloading service php-fpm56: done
So the rebuild process is complete.
Step 4: Recheck Webmail Roundcub
As shown below, after rebuilding, Webmail Roundcube can be accessed. Now you use your email account to log in and recheck the operation.
Summary
So in this article, AZDIGI has shown you how to solve errors related to the Database Roundcube connection in the most detailed and simple way. Although the implementation is simple, you should be careful and follow the instructions exactly as instructed to avoid unnecessary errors. If you find the article helpful, please share it widely.