type in your query to search makeyougohmm
Things that ... make you go hmmtechnology music video art news reviews and muse on the web

June 9, 2004

How to access MySQL from Windows Command Prompt

How To — by TDavid @ 8:40 am PST
F = please no more posts like thisD = not among your best stuffC = average postB = good post, I liked itA = great post, please create more like this (3 votes, average: 5 out of 5)
Loading ... Loading ...

The following tutorial assumes that you already have downloaded and installed MySQL on your Windows machine. From inside Windows here’s how you would access MySQL this way:

1) launch a command window by going to: START->ALL PROGRAMS->ACCESSORIES->COMMAND PROMPT

[NOTE: you can also get to it by going to START->RUN and typing: cmd ]
2) inside the Command Prompt window type: cd c:\mysql\bin
(or change directory to the location that you installed if you didn’t use the default install location)
3) if you don’t have a password set yet, then you can set it easily by typing the following:

mysqladmin -u root password new_password

where new_password is the new password that you would like to use

4) next, when you have already set a custom MySQL root password (step #3) then type: mysql -u root -p

PROBLEM #1: if you receive a message asking for your password then enter the custom password (you’ll see asterisk instead of the password). If for some reason you can’t figure out the password you can reset it by following the instructions here: http://dev.mysql.com/doc/mysql/en/Resetting_permissions.html

PROBLEM #2: If you receive a message that indicates the MySQL server isn’t running then you can start the MySQL service from within the Command Prompt by entering the following: net start mysql — you can also see a list of all running NET services by typing: net start

5) next, if the MySQL server is running and you entered in your password correctly you should now be set to communicate directly with the MySQL server from the Command Prompt just like you would if you were telnet or SSH to MySQL on a server. The command prompt should look like this now:

mysql>

You can now view your available database by typing: show databases

Related Posts

RSS Feed comments for this post No Comments »

Did this make you go hmm?
TrackBack URI: http://www.makeyougohmm.com/20040609/806/trackback/

Leave a comment


By leaving a comment you consent to the Official Hmm Comment Policy

Return Home


Copyright 2003-2008 KMR Enterprises All Rights Reserved