helpfulstuff.org Logo




Home arrow LAMP, WAMP, MAMP, & XAMPP arrow Using MySQL on Microsoft Windows Make Text BiggerMake Text SmallerReset Text Size
Using MySQL on Microsoft Windows PDF Print E-mail
Written by Trevor Gontz   
Wednesday, 19 March 2008

Running MySQL

The following commands assume that C:\Program Files\MySQL Server 5.0\bin has been added to the Windows PATH. If MySQL has not already been added to your Windows PATH then you will have change to the C:\Program Files\MySQL Server 5.0\bin directory before running any of these commands. To learn how to add MySQL to your Windows PATH take a look here.

Logging in to MySQL

1. To log in to MySQL with a password open Command Prompt and type:
mysql -u username -p
For example, to log in as root (administrator) you would type:
mysql -u root -p
You should then be prompted for root's password.
  • Stop the MySQL Service (one of two ways)...
    > NET STOP MySQL
    > mysqladmin -u root -p shutdown
  • Uninstall the MySQL Service...
    > mysqld-max-nt --remove
  • Shutdown the standalone console MySQL application (one of two ways)...
    > mysqladmin -u root -p shutdown [Note that this is done from another cmd.exe window]
    Ctrl-C under the cmd.exe window it was started from

Help

  • Display the MySQL command-line interface (shell) options...
    > mysql --help
  • Display mysql-max-nt options...
    > mysqld-max-nt --help
  • Display MySQL version information...
    > mysqladmin -V
  • See what values a running MySQL server is using...
    > mysqladmin -u <user> -p<password> variables
  • Display information...
    > mysqladmin -u <user> -p<password> version status proc
  • Update password for MySQL user 'root' (from the MySQL shell)...
    mysql> UPDATE mysql.user SET Password=PASSWORD('root-password') WHERE User='root';
    mysql> FLUSH PRIVILEGES;
Last Updated ( Wednesday, 19 March 2008 )
 
< Prev
Open Source