Some MYSQL CLI tricks/commands

Import full mysql dump on CLI

mysql -uroot -p database_name < /file/path/filename.sql

Import full mysql dump on MYSQL CLI

use database_name;
source /file/path/filename.sql;

View users on MYSQL CLI

SELECT User,Host FROM mysql.user;

Delete an user on MYSQL CLI

DROP USER 'testuser'@'localhost';

Change user password on MYSQL CLI

update user set password=PASSWORD('your_new_password') where User='root';

 

Ubuntu 32bits or 64bits?

I’m setting up a new machine with 8cores and 8Gb of RAM.
I had to choose between Ubuntu 32bits or 64bits

Ubuntu 64bits was the choice. Why?

If you have more than 4 GB of RAM go for 64 bit else 32 bit is just fine.

 

Use 64bit in case you do

  • video editing and processing
  • sound editing and processing
  • graphic editing and processing
  • work with large files (e.g. databases, large log files,…)

 

Got it from http://askubuntu.com/questions/19803/for-better-performance-should-i-install-32-bit-or-64-bit

 

 

Simply backups under Linux

Backup a folder

tar -cvpzf /BackupDirectory/backupfilename.tar.gz /ImportantData/directory/path

c =  Create
v =  Verbose mode
p = Preserving Files and Directory Permissions.
z = This will tell tar that compress the files further to reduce the size of tar file.
f =  It is allows to tar get file name.

Backup a MySQL database

mysqldump --opt -u [username] -p[password] [dbname] > [dbname.sql]

Backup all MySQL databases

mysqldump -u root -p --all-databases > all_databases.sql

ssdvirtual

NAS nas4free

 

nas4free: / # df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/md0 223M 216M 7.6M 97% /
devfs 1.0k 1.0k 0B 100% /dev
/dev/ada5a 117M 112M 5.0M 96% /cf
procfs 4.0k 4.0k 0B 100% /proc
RAIDZ 6.7T 51k 6.7T 0% /mnt/RAIDZ
RAIDZ/ARstorage 3.9T 355G 3.6T 9% /mnt/RAIDZ/ARstorage
RAIDZ/CMstorage 2T 82G 1.9T 4% /mnt/RAIDZ/CMstorage
RAIDZ/dataset 6.7T 45k 6.7T 0% /mnt/RAIDZ/dataset
RAIDZ/vmware 500G 321k 500G 0% /mnt/RAIDZ/vmware
/dev/md1 61M 768k 59M 1% /var
nas4free: / #