MySQL Reference Manual-connection and disconnection service_mysql

Source: Internet
Author: User
MySQL Reference Manual-connection and disconnection service providers this chapter demonstrates how to use mysql client programs to create and use a simple database and provides a MySQL Getting Started Tutorial. Mysql is an interactive program that allows you to connect to a MySQL server, run the query, and view the results. Mysql can be used in the batch mode: you put the query in a file in advance and then tell the mysql execution file content. Both methods of using mysql are involved here.
  
To view a selection project table provided by mysql, call it using the -- help option:
  
Shell> mysql -- help
  
This chapter assumes that mysql has been installed on your machine and has a MySQL server that you can connect. If this is not true, contact your MySQL administrator. (If you are an administrator, you will need to consult other chapters in this manual .)
  
This chapter describes the entire process of creating and using a database. If you are only interested in accessing an existing database, you may want to skip the section describing how to create a database and the tables it contains.
  
Since this chapter is essentially a tutorial, many details need to be omitted. For more information about the topics covered here, consult the relevant chapters of this manual.
  
8.1 connection and disconnection service provider
To connect to the server, when you call mysql, you usually need to provide a MySQL User name and probably a password. If the server runs on a machine that you are not logged on to, you also need to specify the host name. Contact your administrator to find out what connection parameters you should use to connect (that is, the host, username and password used ). Once you know the correct parameters, you should be able to connect like this:
  
Shell> mysql-h host-u user-p
Enter password :********
  
* ******* Indicates your password. when mysql displays Enter password: prompt, Enter it.
  
If you can work, you should see some introduction information after the mysql> prompt:
  
Shell> mysql-h host-u user-p
Enter password :********
Welcome to the MySQL monitor. Commands end with; or/g.
Your MySQL connection id is 459 to server version: 3.22.20a-log
  
Type 'HELP' for help.
  
Mysql>
  
The prompt tells you that mysql is ready to enter the command for you.
  
Some MySQL installations allow users to use "anoymous" (anonymous) users to connect to servers running on local hosts. If this is the case on your machine, you should be able to call mysql to connect to the server without any options:
  
Shell> mysql
  
After successful connection, you can break the QUIT at any time at the mysql> prompt:
Mysql> QUIT
Bye
  
You can also type control-D to disconnect

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.