MySQL Reference Manual-8. MySQL tutorial-8.1 connection and disconnection service provider

Source: Internet
Author: User
Tags mysql client mysql tutorial

This chapter demonstrates how to use a mysql client program to create and use a simple database and provide
Getting started. Mysql is an interactive program that allows you to connect
A MySQL server, run the query and view the results. Mysql can be used in batch mode: you put the query in a file in advance
And then tell the mysql execution file. 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 involved here,
Consult the relevant sections 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 should you use to connect (that is, the host, username and password used ). Once you know it is correct
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.

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.