MySQL study Notes-MySQL startup and connection _ MySQL-mysql tutorial

Source: Internet
Author: User
1. check and start the MySQL service. After MySQL is installed in Windows XP, it automatically starts the service and has a shortcut connection to the client in the Start menu. for details, see. 1 .. 1. you can view it in the Windows service manager. "Start"-"run", enter "services. msc", and press enter. The Windows service manager is displayed. 1. View and start the MySQL service
  
After MySQL is installed in Windows XP, it automatically starts the service and has its client shortcut connection in the Start menu. for details, see. 1.
   
. 1
  
You can view it in the service manager of Windows. "Start"-"run", enter "services. msc", and press enter. The service manager of Windows is displayed, and the service item "mysql" is displayed. The service item "started" is displayed on the right, as shown in. 2.
   
. 2
  
If "started" is not displayed, the MySQL service is not started and cannot be connected. Therefore, the error 10061 is returned. The start method is "start"-"run", enter "cmd", and press enter to bring up the XP command prompt interface (similar to the doscommand line, which will be referred to as the command line later ). Enter "net start mysql" to start the mysql service and stop the mysql service "net stop mysql" (note that the MySQL service name is entered here. If your MySQL service name is DB or another name, you should enter "net start DB" or another name), see. 3.
   
. 3
  
   2. connect to the MySQL server
  
Now, connect to the MySQL server. the command format for connecting to MySQL is:
  
Mysql-h host name-u user name-p user password
  
Enter the MySQL directory in the command line, as shown in. 4.
  
. 4
  
Because I didn't set a password at the beginning, press enter. If:
  
Welcome to the MySQL monitor. Commands end with; or \ g.
  
Your MySQL connection id is 1 to server version: 4.1.11-nt
  
Type 'help; 'or' \ H' for help. Type '\ C' to clear the buffer.
  
Mysql>
  
This indicates that the connection to MySQL is successful. "mysql>" indicates that the connection has been successfully established to the MySQL server. you can start msql operations.
  
"-H host name" can also be written as follows: "-h host name" (no space in the middle), "-- host = host name"
  
"-U user name" can also be written as "-u user name" and "-- user = user name"
  
"-P user password" can also be written as "-- password = user password ". However, for security reasons, it is best not to do so. Select-p to tell mysql that you are prompted to enter the password at startup. For example:
  
Mysql> mysql-hlocalhost-uroot-p
  
   3. tips
  
It is very troublesome to connect to the MySQL server like this. you need to first enter the MySQL directory and then connect to MySQL. Here is a tip to quickly connect to the MySQL server.
  
"Start"-"All programs"-"attachments"-"command line prompt", right-click on it, and "send to"-"desktop shortcut ", make a cmd shortcut on the desktop.
  
Right-click the shortcut, click "properties"-"General" tab, and change the name to "MySQL command line ". Go to the shortcut tab and change the start position to "E: \ MySQL Server 4.1 \ bin", including quotation marks.
  
Next time you connect to the MySQL server, click this shortcut to directly enter the Mysql directory and enter the connection command.
  
For more convenient tips, see. 1. There is a "MySQL Command Line Client" on it. click it and the "Enter password:" prompt appears. Enter the password and connect to the MySQL server immediately. you don't need to repeat the connection Command. However, we recommend that you use the following command to familiarize yourself with the use of commands.

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.