Tech blog

Solving problems

About
Contact

Archive for the ‘linux’ tag

Change/Set permissions on external EXT3 USB drive

leave a comment

1 – Go to Terminal, copy & paste this command: gksudo nautilus that will open Terminal as root

2 – Navigate to your new drive, Right Click, select the Permissions tab

3 – Change the Owner drop-down menu to your name, then change Folder Access to Create & Delete Files, then File Access to Read & Write, then Group to your name, Folder Access to Create & Delete Files, File Access to Read & Write then click Apply Permissions To Enclosed Files.

You will now have full access to your drive.

VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Written by Avivo

October 3rd, 2009 at 8:08 am

MySql dump, tar, restore…

2 comments

Very often you need to migrate your MySQL database from one server to another, from Windows to Linux, Linux to Linux….

So, first you need to create dump of your existing database, to export it to a file. Here is the command:

mysqldump -P 3306 -u database_username -p database_name > /home/somedirectory/your_database.sql

-P - means port, if you don’y mention it default port is used (usually 3306)
-u – means database username
-p – means password but we didn’t specified it so after this command is executed we will be asked to type a password
database_name
– is the name of your database you want to export
> location – at the end you specify directory where you want to create this dump

You probably want to zip this and you can use TAR (install Cygwin if working on Windows):
Here is the command:

tar cvf database.tar /home/somedirectory/your_database.sql

Transfer this file on other server using FTP… And unzip it if you want using command:

tar -xvf database.tar

Then import the database:

mysql -P 3306 -u  database_username -p new_existing_database_name < /home/somedirectory/public_ftp/your_database.sql

-P - means port, if you don’y mention it default port is used (usually 3306)
-u – means database username
-p – means password but we didn’t specified it so after this command is executed we will be asked to type a password
new_existing_database_name
– is the name of your existing database on new server where you want to import data
< location – at the end you specify from which directory you want to import database

And thats it…

VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Written by Avivo

February 25th, 2009 at 10:27 am