Introduction: Tools do not bring convenience to our life, but sometimes we forget the meaning of things themselves. When most people are looking for or even blindly follow the various tools that are more advanced, have you ever reconsidered: Do you currently have the qualifications to use it?
If you learn to use a software, you will only be a software, but only through the phenomenon to see the essence, you can understand its true meaning.
Traced back
Now let's go back to the time when MySQL was just developed, there was no phpmyadmin, no navicat and so on, so how do we operate MySQL?
(laziness is the root of social development, and picky is the foundation of Human Progress)
Mysql Client (command line)
Although MySQL is powerful, but it is not so mysterious, according to the popular point of understanding, she is only a warehouse, but this warehouse store is not real objects, but the data, but its use of methods and real warehouse no difference.
At the command line, use the CD command to go to the MySQL installation directory, using the Mysql–h127.0.0.1–uroot–p command, and then follow the prompts to enter the password, (the initial password is empty) to connect to the database
MySQL This command, you open the warehouse key,-h,-u,-p These three parameters is to open the warehouse rules, 127.0.0.1 This IP address is equivalent to the location of the warehouse, and root and password is you open the warehouse credentials, with the key, warehouse address and voucher, You can follow the rules used by the key to operate the warehouse at any location, this sounds very nice
Just like a warehouse in the real world, after opening the warehouse, there may be a lot of rooms, these rooms are stored in different kinds of things, such as the left side of the warehouse is stored in the food, the right is the daily necessities and other things, then I want to know how many warehouses I have, how should I do?
If the storeroom is recorded accordingly, just check the warehouse list.
Use show databases; (Note: Each command requires A; end) command to view the inventory list to list all the names of the databases so that the names of all the warehouses can be displayed.
Own warehouse own master, my warehouse so big, add a storehouse specially put fruit good, use CREATE database fruit;
The fruit warehouse has been set up, then go in and look good, using use fruit; command, because the warehouse is a new open, then there must be no thing inside, first a region dedicated to put Apple, create table Apple (name varchar (40));
Let's take a look at the area we've drawn.
Then we can choose to put a little apple in and pull
It seems as if a golden Apple has been put in, the golden Apple can not eat, also replaced by the Big Apple Good update apple set name= ' Big Apple ' where name= ' golden apple ';
The Apple has already changed, now through the select name from Apple; see how many apples
Two big apples, looking at the envious, ate them all. Delete from Apple where name = ' Big Apple ';
The apple has been eaten, the area is empty, the first empty out of this piece to drop table Apple;
Then look at this warehouse show tables; , it is empty, then the outside of the warehouse also emptied a good drop database fruit;
Tail language
MySQL command is the key to open the MySQL repository, SQL (Structured Query Language) language is the tool to manage the MySQL repository, and now perhaps you use the phpMyAdmin, or Navicate and other Visual database management tools, but the basic operations to encapsulate a layer of , making it easier and quicker for people to use them.
Good tools are used, it brings convenience to people, the use of tools is good, but please do not rely too much on tools, especially in the use of tools, need to ponder: if suddenly one day without such tools, you are ready to wait for others to do a new set of tools come out, Or do you have to re-write a set of such tools?
Understanding MySQL from MySQL command line