Results 1 to 5 of 5

Thread: Need help with a Batch file.. please!

  1. #1
    Spinal Pap Tomahawk's Avatar
    Join Date
    Jul 2003
    Location
    Bristol/Manchester Uni
    Posts
    1,002
    Thanks
    8
    Thanked
    13 times in 8 posts

    Need help with a Batch file.. please!

    Hey,

    Ok basically I am trying to create a Batch file that will sit on my desktop and allow me to connect to my local MySQL database, instead of having to open the command prompt and using "CD G:\blahblah\etc" to finally locate the correct directory/sub-directory, containing the 'BIN' folder to allow me to connect.

    So far I have:

    Code:
    CD D:\MyServer\MySQL\MySQL Server 5.0\bin
    mysql -h localhost -u root -p
    I thought this would open the command prompt, asking me to enter my password to connect to the database, but it runs the commands and then closes instantly. So basically what I need is some way of runnin the above commands and then keeping the command window open, for me to enter my password, and then query the database etc..etc..

    Any help would be great, thanks!



    [ iTomaHawk | My Music MySpace ]

  2. #2
    Senior Member
    Join Date
    Mar 2006
    Location
    London
    Posts
    296
    Thanks
    16
    Thanked
    8 times in 7 posts
    Your script isn't using the correct syntax.
    You'll need something like this:
    Code:
    d:
    cd \MyServer\MySQL\MySQL Server 5.0\bin
    mysql -h localhost -u root -p
    It should then prompt you for the password.

    Good luck

  3. #3
    Spinal Pap Tomahawk's Avatar
    Join Date
    Jul 2003
    Location
    Bristol/Manchester Uni
    Posts
    1,002
    Thanks
    8
    Thanked
    13 times in 8 posts
    Damn.. should of noticed that mistake..!

    Thanks alot Gman!.. works a charm now!


    [ iTomaHawk | My Music MySpace ]

  4. #4
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts
    You could specify your password immediately after the -p switch and it should log you straight in (if that's secure enough for you).
    To err is human. To really foul things up ... you need a computer.

  5. #5
    Spinal Pap Tomahawk's Avatar
    Join Date
    Jul 2003
    Location
    Bristol/Manchester Uni
    Posts
    1,002
    Thanks
    8
    Thanked
    13 times in 8 posts
    Yeah thanks, will try this, as it makes sense as its only for developing/testing, so is only available locally.



    [ iTomaHawk | My Music MySpace ]

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 63
    Last Post: 14-11-2011, 09:17 AM
  2. Need help on my maxtor harddrives
    By arthurleung in forum PC Hardware and Components
    Replies: 10
    Last Post: 12-06-2007, 09:40 PM
  3. Batch file & copy query
    By Fatboy in forum Help! Quick Relief From Tech Headaches
    Replies: 4
    Last Post: 25-04-2005, 03:42 PM
  4. Dodgy DVD-r's ?
    By starside in forum Help! Quick Relief From Tech Headaches
    Replies: 12
    Last Post: 27-03-2005, 06:11 PM
  5. Dos Batch File Help
    By EvilMunky in forum Help! Quick Relief From Tech Headaches
    Replies: 4
    Last Post: 08-03-2005, 12:15 PM

Posting Permissions

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