Posted by Marcelo on Sabadini
28/02/2009
Backup of MySQL on the command line
Hello guys. 've posted about making backups of your MySQL database via Phpmyadmin and you already know how important it is to do backups.
Today I will teach about the backups using the MySQL prompt.
Use phpMyAdmin and much more practical, but over time, your database grows, growing, growing until the Phpmyadmin not take it anymore ... take long to download the file, or leave SQL screen printed on the browser will hang, etc ...
When we do backup operations at the prompt is much faster.
What will basically fly will learn:
- Create a backup of the database;
- Restore a backup;
So let's go!
To back up a database, use the following command:
- mysqldump-h HOST-u USER-p Password-opt-default-character-set = latin1 BASEDEDADOS> NOME_DO_ARQUIVO.sql
- HOST: Is the host to connect to the database. It can be localhost, the server IP address or some other server (Dreamhost is in mysql.serdominio.com.br)
- USER: User to access the database
- PASSWORD: The user's password
- -Opt-default-character-set = latin1: I have had many problems with emphasis on backups from the command line. This option backs up all self-righteousness with the accents (at least in my case).
- BASEDEDADOS: The name of the database that is backed up.
- FILENAME: Is the name of the file will be created. It can be a path, eg: c: \ arquivo.sql (Windows) or / home / arquivo.sql (Linux)
Another advantage to know back in the command line is that you can schedule a script to automatically back up every day for example.
To return a backup, something that can be useful if your database suffers some loss of data, it is very simple. Just run the following command:
- mysql-h HOST-u USER-p Password BASEDEDADOS <NOME_DO_ARQUIVO.sql
Notice the direction of the arrow in this command, pointing to the side of the database (<) unlike when we ran the backup, the arrow was pointing to the side of the file (>).
- HOST: Is the host to connect to the database.
- USER: User to access the database
- PASSWORD: The user's password
- BASEDEDADOS: The name of the database that will receive the data.
- FILENAME: Is the name of the file containing the backup. Here may be the path as well.
[References]
http://dev.mysql.com/doc/refman/4.1/pt/mysqldump.html
http://dev.mysql.com/doc/refman/4.1/pt/mysql.html
Well, I have helped. If you have something to add or ask please post.
A big hug.
Posted by Marcelo on Sabadini
25/02/2009
Zend Studio for Eclipse (6.1)
And then all good guys?
I spent a week working with Zend Studio for Eclipse to test. I particularly liked a lot. Of course I very surprised because I never adapted to the 'format Eclipse to work. But I made an effort to use it.
Well, the things that I used and which does not in Zend Studio 5.5 are:
- "Go to Declaration 'in the variables;
- Refractor for files, classes, functions and variables;
- New PHP Class and PHP Interface;
- Ability to move the order of the tabs;
- Generating Getters / Setter;
- Control 'To the' now is in a bar in order to 'end';
- List of Profiles that have been performed;
Posted by Marcelo on Sabadini
23/02/2009
VMware - Virtual Machine (Linux within Windows or Windows within Linux)
Today I will talk about this very interesting program, VMware.
VMare is a software that allows installation of one (or more) operating system within an operating system. Was it complicated? See the picture below to understand:
Note that the image, a person uses Linux but Windows XP is running one by VMware. And the reverse can also be done: You run a Linux distribution within your Windows.
Or rather, you work with any system that runs on many platforms and need to test all of them ... VMware will be very useful, since you do not need to partition your hard drive in order to install each operating system.
Posted by Marcelo on Sabadini
21/02/2009
Backup for Mysql Phpmyadmin
Personal speech okay?
Today I will talk about a very important thing for a system developer: BACKUP database!
But what good is a backup?
The backup is a way to prevent your system to lose important data, whether through carelessness of another user (human error), or by a power failure, etc ...
Today you will learn to make a backup of your database using Phpmyadmin .
Read the rest of this entry »
Posted by Marcelo on Sabadini
19/02/2009
Generate CSV file
Hello, today prcisei generate a CSV file a report. The process is very simple, yet decided to do a post about it ... you can have someone in need ![]()
As the report that I was actually very simple, I decided to put more bells and whistles on it to get a more complete article.
At the end of this file you will have learned:
- Read a TXT file and insert lines in an array;
- Use the function list () and explode () PHP;
- Use if ternary;
- Write a text file on the server;
Well, as this post is not part of the Mini-course, I will not go line by line. I left the code well commented so that it is easy to understand. If you have any questions, please have a look at the PHP site (php.net / functionname) or post that I or anyone says.
The TXT file is in the following format: name, email, website
Read the rest of this entry »




