MySQL Study Notes 1: Installation and logon

Source: Internet
Author: User
Tags how to use sql linux mint

I started to learn about databases today. Because I don't catch a cold with Microsoft, I don't need his products anymore.

I wanted to install Oracle, but it was too big to be afraid.

MySQL is a good choice for me who like everything in simplicity.

Well, I am too lazy to write about the database theory. I have had enough of the necessary content for those exams.

I only need to know that people are constantly evolving to organize data and files, and now they are using databases for better management.

Next we will start to install

 

I am using Linux mint, A Ubuntu-based release version, which is really good to use.

I will not download, compile, and install package management tools from the official website.

One command:

The password is required during installation, which also saves the trouble of compiling and installing and modifying the configuration file.

What's more, I am a newbie and don't want to combat my learning enthusiasm.

Just one sentence: first understand the basic concepts and usage methods, and then learn the rest of the content as needed.

 

Now that the installation is complete, open it and see how to log on.

Logon Method 1:
 
Mysql-H127.0.0.1-U root-P

This is the most standard Logon method. Because I install it locally, the-H parameter is 127.0.0.1 and can also be written as localhost.

The-u parameter is root, that is, I log on as the root user.

Last-P indicates the password. If you press enter, enter password will be displayed in the next line: prompt to enter the password, but invisible

 

Logon Method 2:
 
Mysql-H localhost-u root-padmin

As mentioned above, it is locally installed. Here I use localhost to represent the address.

You can even use the mysql-u root-p command to omit the host address.

It should be noted that-padmin, in which admin is the password for my database connection

-Padmin must be connected and written. If it is written as-P admin, it is invalid.

 

Logon method 3:
 
MySQL-H localhost-P3306 -U Root-P Test

-P after localhost is connected to the port number. The default value is 3306.

The test at the end indicates that the database is selected as soon as I log on.

 

Logon Mode 4:
MySQL-H localhost-U Root-P-E "show databases"

-E is followed by an SQL statement, which can be executed as soon as you log on.

Note that strings must be enclosed in quotation marks.

 

Logon Method 5:
 
Siu @ darling ~ $ Mysql

This is equally effective, at least I can do this in Linux.

SIU is my user name, the address and user name are omitted, and the password is empty.

You can directly access MySQL under the permission range of this user, but I do not know if it is not recommended.

Currently, I know how to use these logon methods. The combinations can be omitted. You will know how to use them several times.

As for changing the configuration and password, frankly speaking, I won't

Next let's take a look at the information after logon.

 

A bunch of new friends are shown here, and many of them are subconsciously ignored. It is still valuable to take a closer look.

The first line describes how to end the command. Use the; sign or \ G to end the command.

The second line shows the number of your logins. This is 44th logins.

The third line is the current version number. Here I am the Ubuntu release version, which will also be noted later.

Next is copyright or something.

The last line shows the Help Command and the method for clearing the statement.

For example, if I enter a bunch of show databasessssss \ c errors, enter \ c and press enter to clear the statement.

 

Finally, there is a good tool in Linux called phpMyAdmin.

If you are not familiar with database operations, you can try to use it, but you cannot ignore the learning of SQL statements.

For example, I learned how to use SQL statements using phpMyAdmin visualized operations.

For more information, see Ubuntu wiki.

 

 

 

 

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.