Backup of MySQL database with a PHP script

Sometimes you need to make a mysqldump backup without having SSH access or PHPMyAdmin. It can be done with PHP by means of SHOW TABLES/SHOW CREATE TABLE mysql queries. Below is an improved solution proposed here. Improvements: [list style=“upper-alpha tick“] [list_item]Got rid of memory_limit – writing to file on every iteration[/list_item] [list_item]gzip support – you don’t have to download huge uncompressed .sql[/list_item] [list_item]PHP notice fixed[/list_item]…

Setting up mysql proxy (windows)

Sometimes you need to view the exact query that your client sent to the server. For example, if you don’t know how PDO binds and escapes params or you’re using ORM. There is mysql proxy utility to facilitate this. So in order to install it you should: 1. Download the distribution from https://dev.mysql.com/get/Downloads/MySQ … oobly.com/ 2. You don’t need to install anything. Just launch

Elance ANSI SQL code test with answers

Hi all, recently I tried to pass elance sql code test and managed to reply to only 8 out of 10 questions. I sent expert rating a feedback after the first pass as I believe limits should be allowed (however, maybe they are not in ANSI, I don’t remember). Anyway, here are the questions and my answers: 1. Consider a table named „salary“ having the…

Removing duplicate rows in MySQL

Getting rid of duplicate table rows in mysql seems to be a very often issue. And there are few well-known solutions like e.g. creating temporary table and copying there only unique ones with group by and then drop the old and rename the newly one. But this solution is bad because we lose auto_increment counters and we might not have all grant privileges to do…

Seite 1 von 1