Results 1 to 5 of 5
  1. #1

    Default Basic Mysql command for beginners

    To enter the mysql from root

    # mysql
    To change the database

    #use database name;

    Ex. use test_test;
    To see the tables under the database

    #show tables ;
    To see the particular table details
    #select * from table ;

    Ex. select * from test_admin ;
    To restore the database backup from .sql file
    #mysql -u username -ppassword databasename < .sql file

    Ex. mysql -u test_test1 -ptesting test_test < test.sql
    To see the current running mysql process

    #mysqladmin processlist or #mysqladmin proc stat
    To take the backup of mysql database

    #mysqldump --opt db_name > backup-file.sql

    Ex. mysqldump --opt test_test > test.sql
    You can restore the dump file back into the database like this:
    #mysql db_name < backup-file.sql

    Ex. mysql test_test < test.sql
    To dump all databases, use the --all-databases option:

    #mysqldump --all-databases > all_databases.sql
    Regards
    George
    http://eUKhost.com

  2. #2

    Default

    err... where r you ment to type those comands please?

  3. #3
    Join Date
    Oct 2006
    Posts
    377

    Thumbs up Hello

    Hello,

    First command will give you mysql prompt and then you will be able to run all remaining commands.

    On linux server, Login to Shell through SSH and then give following command on a hash (#) prompt :
    #mysql
    OR
    #mysql -u<user> -p<password>
    If you have mysql-5.0.81 then above commands will show you following output :

    root@vps [~]# mysql
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 30202
    Server version: 5.0.81-community MySQL Community Edition (GPL)

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    mysql>
    On a Windows server, open a command prompt and go to the path where mysql is installed. For example on Windows-Plesk Server you will find mysql.exe in C:\Parallels\Plesk\Databases\MySQL\bin

    Run following commands on windows command prompt :

    >cd \
    >cd C:\Parallels\Plesk\Databases\MySQL\bin
    >mysql -u<user> -p<password>
    Please feel free to reply if you have any further queries.

    Best Regards,
    Sebastian
    Senior System Administrator
    http://www.eukhost.com/

  4. #4

    Default

    WoW you guys know so much. how do you remember all that?
    Seems a bit deep for me but thanks for the info.

  5. #5
    Join Date
    Oct 2006
    Posts
    377

    Thumbs up Hello

    Hello,

    Yeah, it's our daily work so we remember it. Thanks for your appreciation.


    Best Regards,
    Sebastian
    Senior System Administrator
    http://www.eukhost.com/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •