Mysql tutorial common command set
Create database name; create database tutorial
Use databasename; select database
Drop database name directly deletes the database, no reminder
Show tables; displays tables
Describe tablename; Detailed description of the table
Add distinct to the select statement to remove duplicate fields.
Before mysqladmin drop databasename deletes a database, a message is displayed.
Display current mysql version and current date
Select version (), current_date;
2. Modify the root password in mysql:
Shell> mysql-u root-p
Mysql> update user set password = password ("xueok654123 ') where user = 'root ';
Mysql> flush privileges // refresh the database
Mysql> use dbname; open the database:
Mysql> show databases; displays all databases
Mysql> show tables; display all tables in mysql: use mysql first; then
Mysql> describe user; displays the column information of the user table in the mysql database );
3. grant
Create a full Super User that can connect to the server from anywhere, but you must use a password something to do this
Mysql> grant all privileges on *. * to user @ localhost identified by 'something' with1 2