How to use CMD to connect Mysql database _mysql

Source: Internet
Author: User
Tags mysql version

The MySQL tutorials and MySQL reference books that we see on the Web are usually the CMD commands and result sets.
Perhaps some beginners do not know which corner of the system to enter these commands, or to start some MySQL tools, below teach you how to enter this MySQL cmd mode and basic MySQL operation.
Take the window System for example, first, we move the mouse to the beginning of the lower left corner, click the "Start" button, find "Run", open the run, in the input box entered "cmd", and then press ENTER (that is, enter the key), then entered the cmd mode (a background for the black window, There are some English letters in it.
When we open cmd, we see that C:\Ducuments and settings\administrator> (some friends ' systems don't use the administrator system users, If you enter user for the window system, the administrator is changed to user.
In fact, this string of English letters is a system position, now into the location after the cmd: C disk in the Ducuments and settings directory of the Administrator directory, then, since the location of this cmd to know the meaning of what we will do next? Right, is to enter the MySQL bin directory, to be able to use CMD to start MySQL.
Take mysql5.0, for example, the MySQL installation directory in the C disk directory of the program Files MySQL inside MySQL Server 5.0 (that is, C:\Program Files\mysql\mysql Server 5.0), then, We are ready to enter the catalogue.
The steps are as follows:
C:\Ducuments and Settings\administrator> cd\ (enter)
Appears below:
C:\>
Step Two:
C:\>CD C:\Program files\mysql\mysql Server 5.0\bin (Enter)
Appearing: C:\Program files\mysql\mysql Server 5.0\bin>
Step three: (Connect MySQL server)
C:\Program files\mysql\mysql Server 5.0\bin>mysql-hlocalhost-uroot-p (Enter)
(The above-hlocalhost refers to the use of local users to connect,-uroot refers to the use of user name root of the user to connect,-p refers to the null password, the general beginners have not set the root user password, If you configure the server after the installation mysql5.0, the first one to set the password of root, please remember, fill it with the above-p
After a successful connection, the MySQL welcome and MySQL version number will appear.
Then CMD's letter appears as:
Mysql>
That means a successful connection to the MySQL server, and later see the reference book inside the command, for the mysql> command, you enter the line here, the result of the rally appeared in CMD.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.