MYSQL common command list

MYSQL common command list

1, system management,

MySQL -h host address -u user name -p

connects MYSQL (in mysql/bin)

exit

exits the MYSQL command

, mysqladmin, -u, user name, -p, old password, password, new password,

modify password (in mysql/bin)

grantselect[insert][, update][, delete]on, database.*to, user name @localhost ("%" any host); identifiedby " password "

adds user

mysqldump – U root – P ­ ­ opt; database name > backup file name

backup database (in mysql/bin)

MySQL – U root – P < batch­

; file (for example, backup file name)

uses batch

mysql.server start

startup server

mysql.server stop

stop server

msql.server­ ­ log

2, query command

, select, Version ()

query version number

select current_date

query current date

3, display command

show databases

displays database list

The

show tables displays the data table

in the libraryThe

describe table name shows the structure of the data table

The

select * from table name displays the record

in the table

, select, what_to_select, from, which, table, [whereconditions_to_satisfy, and (or), where, conditions_to>

Leave a Reply

Your email address will not be published. Required fields are marked *