Linux Sever

    How to create new user in mysql

    To create new user in mysql. Login to mysql and run following commands:
    mysql> CREATE USER 'mohitsharma'@'localhost' IDENTIFIED BY 'secretpassword';

    mysql> GRANT ALL PRIVILEGES ON * . * TO 'mohitsharma'@'localhost';

    to grant specific permission to table to database will be covered in other chapter


    mysql> exit

    $: mysql -u mohitsharma -p and Enter
    Easy & Done :)

    How to install LAMP Linux Apache Mysql PHP on ubuntu 14.04 LTS

    To Install LAMP on Ubuntu 14.04 LTS Simply Type these commands Install Apache $: sudo apt-get update $: sudo apt-get install apache2 Install Mysql $: sudo apt-get install mysql-server php5-mysql Secure mysql $: sudo mysql_install_db $: sudo mysql_secure_installation Choose options whatever you need Install PHP $: sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt PHP File Configuration to select from directory $: sudo vi /etc/apache2/mods-enabled/dir.conf and paste DirectoryIndex index.php index.html index.

    How to diagnose disk full problem linux

    Find all files greate then 10M size

    sudo find / -type f -size +10M -exec ls -lh {} \;

    in the output look for log files and make them empty

    cat dev/null > logfile_path

    How to download file via scp

    To download file using scp you need ssh username, password and host 1. First open terminal and type
    mohit@ubuntu: scp <myusername>@<hostname>:<pathtofile>

    Press enter

    Yes to add to known hosts

    Enter ssh password and done file start downloading to you local

    mohit@ubuntu: ls
    file will be displayed to you


    <myusername> ssh username
    <hostname> like or whatever it is to be
    <pathtofile> file path with filename to download like /var/www/test.sql

    Note: use sudo with scp command if you don't have root permissions

    How to check os name on server via ssh

    To check os name on server via ssh use following command

    [root@cl-t015-3442cl ~]# uname -a

    You can get output like this:

    Linux cl-t094-3442cl 2.6.18-194.11.3.el5PAE #1 SMP Mon Aug 30 17:02:48 EDT 2010 i686 i686 i386 GNU/Linux

    How to password protect directory on godaddy linux hosting

    Check the detailed explanation here

    How to check mail server is working or not