MYSQL commonly used tool

1.mysql (Client Link Tool):
   -u: Specifies the user name

   -p: specify a password

   -h: Specifies the domain name server ip or

   -P (uppercase): Port
  example: mysql -u -h 202.194.132.237 -P root 3306 -p
     appear error: Host '202.194.132.237' is not allowed to connect to this MySQL server
  appears above reasons is because: the user does not have the right to remotely access, you must modify the database login user permissions.
  setting user administration:
  Grant permissions The list [(field list)] on the table name to the database name username @ domain name or ip address [identified by 'password'] [with the Option Grant]
  EG:
     1. Grant to wuxiaoxiao All ON * * @ '%' IDENTIFIED. by '870 805'
     2. Grant SELECT * to ON Java wuxiaoxiao@'202.194.132.% 'IDENTIFIED by' 870 805. ';
        Grant Update (name) to ON java.customer wuxiaoxiao @'% ';
     3. Grant All ON * . * to wuxiaoxiao @ 'localhost' identified by '870805';
  revoke permission list [(field list)] on the database table name from username @ domain name or ip address.
     EG:. revoke the Create, drop ON the Java * from wuxiaoxiao @ '%';
        revoke Grant the Option ON the Java * from wuxiaoxiao @ localhost. ;
 after landing system: select current_user (); link to view the current user

  --default-character-set = gbk: set the client character set options
 eg: mysql -u root --defaule-character -set = gbk -p after landing :
    equivalent names GBK and the sET;
    Show the Variables like 'Chara%'; see the client character set
    
-e: execute sql statement and exit:
  msyql -u root -e "the SELECT * from the User" data trousers name -p

-E: the order of the fields in accordance with the output displayed vertically
-s: remove mysql lines in the frame display
EG: the root mysql -u -e "SELECT * from User" the BBS -p -E

-f: performing forced sql statement
-v: show more Rich
--show-warnings: a warning message appears
eg:
there is a test in a database table t2, only one field id, is an int
following several insert statement (a.sql):
T2 values INTO INSERT (. 1);
INSERT INTO T2 values (. 2A); // Error
insert into t2 values (3);
do not add any parameters:
MySQL -u the root Test (Database-name) <a.sql
an error occurs , did not execute a sql
plus parameters -f:
MySQL -u root the Test (Database-name) -f <a.sql
the line is not only wrong execution
with the -v displays detailed information inserted:
MySQL -u root the Test (database-name) -f -v < a.sql
plus-Represents warnings --show
MySQL -u the root Test (Database-name) -f -v --show-Represents warnings <a.sql

2.myisampack (MyISAM table compression tools)
  EG: myisampack T3 (t3.myd)

3.mysqladmin (MySQL administration tool)
  some of the features mysqladmin and mysql client to perform after landing very similar!
  commands can be executed:

Guess you like

Origin www.cnblogs.com/jpfss/p/11490779.html