Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Pineco.de:
Scheduling MySQL Backups with Laravel
May 28, 2018 @ 18:19:16

On Pineco.de they've posted a new tutorial showing you how to create a MySQL database backup system using Laravel and a command-line call to mysqldump wrapped in an Artisan command.

A few days ago, I signed in to the wrong database and deleted around 18 000 records that were in use. Not to mention, we had no backup for that data. So after all, I decided to make a little script to dump the database and save it to an SQL file automatically.

But, if you are here for a fully working backup system, you should take a look at <a href="https://github.com/spatie/laravel-backup>this package. We won’t cover more just scheduling database exports and its scheduling.

The post starts with the command that will be executed on the command-line and the code required to "warm up" the console and run the command. He shares the code for this command and walks through it, explaining each part. Next comes the scheduling of the task and, as a bonus, setting up the scheduler to run on the Forge service.

tagged: schedule mysql backup laravel mysqldump tutorial

Link: https://pineco.de/scheduling-mysql-backups-with-laravel/

Tibo Beijen's Blog:
Fixing mysqldump on Zend Server CE on OS X
Mar 01, 2011 @ 17:50:58

Tibo Beijen has a new post today showing his method for fixing mysqldump on Zend Server CE running on an OS X platform. The default install throws a socket error when you try to dump a database using the command.

Inspecting the mysql configuration contained in /usr/local/zend/mysql/data/my.cnf confirmed that the section [client] showed the socket as returned by executing SHOW VARIABLES; from the mysql client: /usr/local/zend/mysql/tmp/mysql.sock Although it is possible to specify the socket by using mysqldump's --socket switch, that doesn't really seem a 'solution'.

As a real solution to the problem was to copy over the my.cnf file from the custom location Zend Server has it in to the default "/etc/my.cnf" with settings pointing to the correct MySQL socket.

tagged: mysqldump zendserver osx socket error fix

Link:

Sephiroth.it:
Backup your batabases w/o phpmyadmin
Apr 07, 2006 @ 12:28:40

As most people, especially those on a shared hosting environment, know, phpMyAdmin can be indespensible for managing your database setup. There are times, however, when you need to work with your databases without it - epecifically in doing a backup. If all you're left with is the command line and you need to make a backup quick, Sephiroth.it has a quick tip to help out.

I often read threads about export/import data from MySQL and it's always mentioned phpmyadmin as the only way to do that (with PHP indeed).

But that's not true, and it's indeed the slower way to do that, expecially when importing large database files (because phpmyadmin has problems with large db)...

He gives an example of the mysqldump functionality, complete with parameters for passing in things like a username and password. The reverse is also shown - reimporting the database data back into the system.

tagged: database backup without phpmyadmin mysqldump export import database backup without phpmyadmin mysqldump export import

Link:

Sephiroth.it:
Backup your batabases w/o phpmyadmin
Apr 07, 2006 @ 12:28:40

As most people, especially those on a shared hosting environment, know, phpMyAdmin can be indespensible for managing your database setup. There are times, however, when you need to work with your databases without it - epecifically in doing a backup. If all you're left with is the command line and you need to make a backup quick, Sephiroth.it has a quick tip to help out.

I often read threads about export/import data from MySQL and it's always mentioned phpmyadmin as the only way to do that (with PHP indeed).

But that's not true, and it's indeed the slower way to do that, expecially when importing large database files (because phpmyadmin has problems with large db)...

He gives an example of the mysqldump functionality, complete with parameters for passing in things like a username and password. The reverse is also shown - reimporting the database data back into the system.

tagged: database backup without phpmyadmin mysqldump export import database backup without phpmyadmin mysqldump export import

Link:


Trending Topics: