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:
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
No comments:
Post a Comment