Author Topic: Server never make mysql backup  (Read 18463 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Server never make mysql backup
« on: July 14, 2019, 12:14:20 PM »
Hi all,

I've a fresh VPS that is hosting 3 simple sites, I decided to use CWP, I really like it, But I faced some issues,

The current issue is backup, The daily backup, in mysql directory, all db are 0 Bytes!! although the main site db is more than 400MB.

I tried to make a full backup from user panel, I got the same issue, db file is 0 Byte.

Any solution for that issue?

Offline
*
Re: Server never make mysql backup
« Reply #1 on: July 14, 2019, 04:00:26 PM »
cwp is using mysqldump so you can try first manually to see if it is working

http://wiki.centos-webpanel.com/import-export-mysql-database
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
*
Re: Server never make mysql backup
« Reply #2 on: July 14, 2019, 05:07:20 PM »
cwp is using mysqldump so you can try first manually to see if it is working

http://wiki.centos-webpanel.com/import-export-mysql-database

I tried it manually and got that error "mysqldump: unknown variable 'local-infile=0'", After removing this line "local-infile=0" from my.cnf, it done successfully.

Thanks for help.

Offline
*
Re: Server never make mysql backup
« Reply #3 on: July 14, 2019, 05:17:37 PM »
cwp is using mysqldump so you can try first manually to see if it is working

http://wiki.centos-webpanel.com/import-export-mysql-database

I tried it manually and got that error "mysqldump: unknown variable 'local-infile=0'", After removing this line "local-infile=0" from my.cnf, it done successfully.

Thanks for help.

Do you have [mysqld] along with local-infile=0? It should look like the following in your etc/my.cnf file:

[mysqld]
local-infile=0


Offline
*
Re: Server never make mysql backup
« Reply #4 on: July 14, 2019, 05:31:05 PM »
cwp is using mysqldump so you can try first manually to see if it is working

http://wiki.centos-webpanel.com/import-export-mysql-database

I tried it manually and got that error "mysqldump: unknown variable 'local-infile=0'", After removing this line "local-infile=0" from my.cnf, it done successfully.

Thanks for help.

Do you have [mysqld] along with local-infile=0? It should look like the following in your etc/my.cnf file:

[mysqld]
local-infile=0

You are right, [mysqld] was missing, after adding it as you mentioned, also mysqldump worked fine.
Thank you.

Offline
*
Re: Server never make mysql backup
« Reply #5 on: July 14, 2019, 11:10:34 PM »
No problem. I went through the same thing a while back.

Offline
*
Re: Server never make mysql backup
« Reply #6 on: April 02, 2020, 03:40:19 PM »
cwp is using mysqldump so you can try first manually to see if it is working

http://wiki.centos-webpanel.com/import-export-mysql-database

I tried it manually and got that error "mysqldump: unknown variable 'local-infile=0'", After removing this line "local-infile=0" from my.cnf, it done successfully.

Thanks for help.

Do you have [mysqld] along with local-infile=0? It should look like the following in your etc/my.cnf file:

[mysqld]
local-infile=0

You are right, [mysqld] was missing, after adding it as you mentioned, also mysqldump worked fine.
Thank you.

Thank you! (i had the same problem)

Offline
*
Re: Server never make mysql backup
« Reply #7 on: April 16, 2020, 12:05:19 AM »
In my case sql backup doesn't work due to account username being longer than database name. I migrated cpanel account where db is imported from old naming scheme but account was created on new one allowing long usernames.

For example, username on account is 12345678910 but database name is 12345678_dbx. Query which gets database names for given account uses "username" string thus it fails to find mysql db. (It takes as mandatory that all databases under account must start with username_xx string.)

Workaround is to create daily cron job which will dump db to home dir to be packed later by backup.

Re: Server never make mysql backup
« Reply #8 on: April 16, 2020, 09:40:22 AM »
I actually agree with the policy of matching database prefix with the username. WHM/cPanel pandered to Windows/Mac lusers by allowing a larger prefix/username, IMHO.
Personally, I'd have renamed the username.
Each to their own, as the saying goes.

Offline
*
Re: Server never make mysql backup
« Reply #9 on: April 16, 2020, 02:10:05 PM »
I actually agree with the policy of matching database prefix with the username. WHM/cPanel pandered to Windows/Mac lusers by allowing a larger prefix/username, IMHO.
Personally, I'd have renamed the username.
Each to their own, as the saying goes.

Yes that makes sense to some point. Much better would be to query for all db-s owned by "username" than to match predetermined name prefix.
It's something i'll try to dig in following days.
Changing username on account is not simple task in production.

Re: Server never make mysql backup
« Reply #10 on: April 16, 2020, 02:42:59 PM »
Hmm, might consider extending my custom backup, to cater for the imported cPanel scenario. May not be able to post it here though, given recent events.  ;)

Re: Server never make mysql backup
« Reply #11 on: April 16, 2020, 10:30:51 PM »
I've had a look at my custom script and how database relationships are stored and it doesn't appear to be very straightforward (not impossible).
I'd need to restore a few more cPanel accounts, to get a better picture on what's going on.
Example:
mysql/db stores users against databases but can contain near duplicates such as, user maps to all user databases and user_xxxx maps to database_yyyy

Any queries (to grab the list of user databases) may need to exclude root,postfix and roundcube


The developers are likely have a better insights as to how this may be achieved.
« Last Edit: April 16, 2020, 10:39:52 PM by ejsolutions »

Offline
*
Re: Server never make mysql backup
« Reply #12 on: December 20, 2020, 04:39:52 PM »
Thanks Rug3r! I had this issue foir a while and this solved it! Thanks!

cwp is using mysqldump so you can try first manually to see if it is working

http://wiki.centos-webpanel.com/import-export-mysql-database

I tried it manually and got that error "mysqldump: unknown variable 'local-infile=0'", After removing this line "local-infile=0" from my.cnf, it done successfully.

Thanks for help.

Do you have [mysqld] along with local-infile=0? It should look like the following in your etc/my.cnf file:

[mysqld]
local-infile=0