owncloud / docs-server

ownCloud Server Documentation
https://doc.owncloud.com
GNU Affero General Public License v3.0
12 stars 30 forks source link

Using the example giving for backing up MySQL/MariaDB could result in an error. #1286

Open core2lord opened 6 months ago

core2lord commented 6 months ago

WHAT Needs to be Documented?

Potential issue under backup example for 'MySQL/MariaDB':

If the user enters a password after the [-p] switch, upon executing the command you will still receive an additional prompt asking for the database password. Regardless of whether the correct password was entered or not, the result will be an authentication error because it appears to be parsing the original 'password' as the database name instead.

This was my experience anyhow on MariaDB 10.6.16 & Ubuntu 22.04.1

Example of the error:

mysqldump: Got error: 1044: "Access denied for user 'owncloud'@'localhost' to database 'mydbpassword'" when selecting the database

Updated 'MySQL/MariaDB' example:

sudo mysqldump \
  --single-transaction \
  -h [server] \
  -u [username] \
  -p \
  [db_name] > owncloud-dbbackup_`date +"%Y%m%d"`.bak
sudo mysqldump \
  --single-transaction \
  -h localhost \
  -u username \
  -p \
  owncloud > owncloud-dbbackup_`date +"%Y%m%d"`.bak

WHERE Does This Need To Be Documented (Link)?

https://doc.owncloud.com/server/next/admin_manual/maintenance/backup_and_restore/backup.html

Category 'MySQL/MariaDB'

WHY Should This Change Be Made?

Preventing an error that could confuse the user executing the task.

(Optional) What Type Of Content Change Is This?

(Optional) Which Manual Does This Relate To?