MySQL basic commands and management tools

mysql -u username -p password                                 MySQL user login
grant permission on library name. table name to user@'%'       to assign user permissions, revocation is revoke
flush privileges
use database name Select the database to operate
show processlist View MySQL running processes
show databases View all databases
show tables View all tables of the selected library
show character set like 'utf8' shows all available character sets
show full columns from library name. table name to view all field structures of a table
show engines Displays the status information of storage engines
show index from library name. table name View the index of a table
show [global | session] variables like variables to view MySQL parameter variable values
set global variable parameter name = set value Modify MySQL variable parameters online without restarting MySQL
show engines Displays the status information of storage engines
show [global | session] status View MySQL server status information
show innodb status View the status information of the InnoDB engine
show profile set profiling=1, used to analyze the execution resources of the query
ps -el|grep mysqld to see if MySQL is running
ps ax|grep mysql View some core configuration directory locations of MySQL
ps axu|grep mysql View some core configuration directory locations of MySQL
mysqladmin option shutdown shuts down the server reload reloads the permission table kill id, id.... kills the Mysql process
                                                                ping checks if mysqld is alive password changes the old password to the new one 
MySQL management tools:

   1. MySQL Front data table management is convenient, it is more convenient to view the overall status of the database

   2. Navicat is suitable for Win, Mac and Linux platforms, with rich functions and convenient interface; convenient management, especially data synchronization, transmission, import and export

   3. SQLyog data synchronization, data backup and migration is fast and convenient, batch running SQL scripts is fast, and SQL formatting is very convenient


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325477776&siteId=291194637