Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Little Mysql starter for backtrack

  1. #1
    Very good friend of the forum drgr33n's Avatar
    Join Date
    Jan 2010
    Location
    Dark side of the moon ...
    Posts
    699

    Post Little Mysql starter for backtrack

    Hey all

    Nobody probably uses mysql here but I'l post it anyway. Just a tiny script to start a mysql database at localhost on port 3306. I'm going to use it eventually in my uprated airsnarf script.

    I hope to add to airsnarf a few extra options like add WEP & WPA and a option to bind two cards so users can actualy connect to the net Also hope to add things like mysql so you can be abit more advanced with the htdocs side of things.

    I am still a baby when it comes to this sort of thing, I have taught myself php and a little perl for my last job on the side. But I did rob a script here and modify it so if you wana bitch slap me I deserve it.

    Would anybody be intrested in this sort of thing? Or does somthing like this already exist and I'm wasting my time?

    Code:
    #!/bin/sh
    #
    #### Backtrack 2 Mysql Startup Script by Dr_Gr33n ####
    #
    option=6
    
    echo "Welcome do the Dr_Gr33n's Backtrack 2 Mysql Startup Script"
    #
    echo "1) Start Small Server"
    echo "2) Start Medium Server"
    echo "3) Start Huge Server"
    echo "4) Check Mysql is running"
    echo "5) Stoping Mysql"
    echo "0) Exit"
    read option
          case $option in
    
                  1) echo "Starting Small Server"
                     cp /etc/my-small.cnf /etc/my.cnf
                     chown -R root  .
                     chown -R mysql /var
                     chown -R mysql /var/lib/mysql
                     /usr/bin/mysql_install_db --user=root
                     /usr/bin/mysqld_safe --user=root &
                     su
                     mysql;;
                  2) echo "Starting Medium Server"
                     cp /etc/my-medium.cnf /etc/my.cnf
                     chown -R root  .
                     chown -R mysql /var
                     chown -R mysql /var/lib/mysql
                     /usr/bin/mysql_install_db --user=root
                     /usr/bin/mysqld_safe --user=root &
                     su
                     mysql;;
                  3) echo "Starting Large Server"
                     cp /etc/my-huge.cnf /etc/my.cnf
                     chown -R root  .
                     chown -R mysql /var
                     chown -R mysql /var/lib/mysql
                     /usr/bin/mysql_install_db --user=root
                     /usr/bin/mysqld_safe --user=root &
                     su
                     mysql;;
                  4) echo "Checking Mysql is running"
                     /usr/bin/mysqladmin -u root -p version
                     cd /root;;
                  5) echo "Stoping Mysql Server"
                     /usr/share/mysql/mysql.server stop
                     cd /root;;
                  0) echo "*** Bye ***"
                      ;;
                  *) exit &;;
          esac
    Just paste the above into kwrite, save it to root as somthing like mysqlstarter and chmod it to 755.

    Then just type run it from shell EG:

    bt ~ # mysqlstarter

    If I have done anything wrong, let me know.

    have fun

  2. #2
    Moderator theprez98's Avatar
    Join Date
    Jan 2010
    Location
    Maryland
    Posts
    2,533

    Default

    This is very useful to use with GPSdrive.
    "\x74\x68\x65\x70\x72\x65\x7a\x39\x38";

  3. #3
    Very good friend of the forum drgr33n's Avatar
    Join Date
    Jan 2010
    Location
    Dark side of the moon ...
    Posts
    699

    Default

    Glad to hear somebody found this usefull

  4. #4
    Moderator theprez98's Avatar
    Join Date
    Jan 2010
    Location
    Maryland
    Posts
    2,533

    Default

    Quote Originally Posted by Dr_GrEeN View Post
    Glad to hear somebody found this usefull
    I don't often have use for MySQL but it is nice for this particular mission.
    "\x74\x68\x65\x70\x72\x65\x7a\x39\x38";

  5. #5
    My life is this forum thorin's Avatar
    Join Date
    Jan 2010
    Posts
    2,629

    Default

    Excellent script Doc.

    For option 5 I'm pretty sure you want "Stopping" not "Stoping" which is a geologic process to do with magma
    I'm a compulsive post editor, you might wanna wait until my post has been online for 5-10 mins before quoting it as it will likely change.

    I know I seem harsh in some of my replies. SORRY! But if you're doing something illegal or posting something that seems to be obvious BS I'm going to call you on it.

  6. #6
    Very good friend of the forum drgr33n's Avatar
    Join Date
    Jan 2010
    Location
    Dark side of the moon ...
    Posts
    699

    Default

    lol you learn something new everyday

  7. #7
    Senior Member
    Join Date
    Feb 2008
    Posts
    681

    Default

    Nicely done doc scripts are fascinating.
    [FONT=Courier New][SIZE=2][FONT=Courier New]hehe...
    [/FONT][/SIZE][/FONT]

  8. #8
    Just burned his ISO ckyned's Avatar
    Join Date
    May 2008
    Posts
    6

    Exclamation Error Login Mysql

    I tried the script. It worked for me, but I cant access the mysql root acc.
    I got this error:

    bt ~ # /usr/bin/mysqladmin -u root password testpass
    /usr/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'

    I used my root login password & default root's password "toor", but no luck.

    -appreciate any help ;-)

  9. #9
    Very good friend of the forum drgr33n's Avatar
    Join Date
    Jan 2010
    Location
    Dark side of the moon ...
    Posts
    699

    Default

    the password is nothing, just hit enter

  10. #10
    Just burned his ISO ckyned's Avatar
    Join Date
    May 2008
    Posts
    6

    Default solved it!

    Quote Originally Posted by Dr_GrEeN View Post
    the password is nothing, just hit enter
    thnx Dr_GrEeN, it worked out

Page 1 of 2 12 LastLast

Posting Permissions

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