MySQL Getting Started series: MySQL tutorial (1)

Source: Internet
Author: User
Tags mysql client mysql tutorial mysql version table name

Now that we have all the basics we need, we can put MySQL into work! This section provides a tutorial that helps familiarize yourself with MySQL. When you complete this tutorial, you will create a sample database and a table in the database, and then add, retrieve, delete, and modify information to interact with the database. In addition, in the process of manipulating this sample database, the following things will be learned:

How to use the MySQL client program to communicate with MySQL.

The basic statement of the SQL language. (If you've ever used another RDBMS to familiarize yourself with SQL, it's also nice to explore the tutorial and see how the MySQL version of SQL differs from your familiar version.) As described in the previous section, MySQL employs the client/server architecture, where the server runs on the machine that hosts the database, and the client connects to the server over the network. This tutorial is primarily based on MySQL client applications. MySQL reads your SQL queries, sends them to the server, and displays the results. MySQL runs on all the platforms that MySQL supports and provides the most direct means of interacting with the server, so it is first and foremost a logical client.

In this book, we will use samp_db as the name of the sample database. However, it is possible that you need to use another database name in the process of completing this example. Because someone may have already used the name samp_db on your system, or the administrator has given you another database name. In the following example, in either case, use a number

According to the actual name of the library instead of samp_db. Table names can be used as precisely as the example shows, even if more than one person in the system has their own sample database. By the way, in MySQL, it doesn't matter if someone uses the same table name. Once each user has its own database, MySQL will keep these database names, to prevent users from interfering with each other.

1.4.1 Basic Requirements

To test the example in this tutorial, MySQL must be installed. In particular, you must have access to the MySQL client and a MySQL server. The corresponding client program must be located on your machine. At a minimum, you need a MySQL program, preferably a mysqlimport program. The server can also be located on your machine, although this is not required. In fact, as long as it is allowed to connect to the server, it does not matter where the server is located. If the server happens to be running on your machine and the appropriate client program is installed, you can start experimenting. If you still need to try to get MySQL, see Appendix A, "Getting and installing software." If you are installing MySQL yourself, refer to this chapter or give it to the administrator. If network access is done through an Internet service provider (ISP), check to see if the service provider has MySQL. If the ISP does not provide MySQL service, see Appendix J, "Internet service Provider", to get some advice on choosing a more appropriate service provider.

In addition to the MySQL software, you need to have permission to create the sample database and its tables. If you do not have this permission, you can consult the MySQL administrator. Administrators can provide this permission by running MySQL and publishing the following commands:

The difference between MySQL and MySQL

To avoid confusion, it should be stated that "MySQL" refers to the entire Mysqlrdbms, while "MySQL" represents a specific client program name. They are pronounced the same, but can be distinguished by different uppercase and lowercase characters and fonts. Regarding pronunciation, MySQL's pronunciation is "My-ess-queue-ell". We know this is because this is pronounced in the MySQL reference guide. and SQL is pronounced "sequel" or "Ess-queue-ell". I don't think which pronunciation is better. It is OK to read any sound, but when you read to others, he may use what he thinks is "correct" to correct you.

The previous command allows it to fully access the SAMP_DB database and all of its tables when Paul connects from the localhost (the server runs on the same host that is running). It also gives a password secret. The second command is similar to the first, but allows Paul to connect from any host ("%" is a wildcard character). You can also replace "%" with a specific host name so that Paul can only connect from that host. (If your server allows anonymous access from localhost, such a grant statement may be necessary because the server searches for an authorization table to find the way in which the input connection matches.) More detailed information about the grant statement and setting up the MySQL user account can be found in the 11th chapter, "General MySQL management."

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.