What are the common statement commands for creating MySQL
This article mainly introduces what commonly used sentence commands are used to create MySQL, and the contents of the article are carefully selected and edited by the author, which are targeted and of great significance to everyone's reference. let's work with the author to understand what commonly used sentence commands are used to create MySQL.
MySQL common statement commands
Modify root password
SET PASSWORD FOR 'root'@'localhost' = PASSWORD (' newpass')
Create the database:
Create database cacti
Add new customers and grant permissions
Grant all on cacti.* to cacti@localhostidentified by "cacti"
Refresh permissions
Flush privileges
Import data
Mysql-uroot-p cacti use mysql
> update user set Update_priv ='Y 'whereuser =' root'
View temporary tables
Show variables like "tmp%"
Set the global temporary table size
Setglobal tmp_table_size=33554432
Modify MySQL remote connection permissions
Grant all privileges on *. * to 'root'@'%'identified by "123" with grant option
Show current user permissions
Show grants for root@'localhost'
Backup database
Mysqldump-uroot-p-database
Slow query log analysis
Open slow query
Log-slow-queries=/var/log/mysqld-slow.log
Long_query_time=2
/ / dbquery-slow
Query_time query time
Lock_time lock time
Number of rows returned by rows_send query
Number of rows for all queries in rows_examind
Timestamp timestamp
View the tablespace management type of the current database
Show variables like "innodb_file_per_table"
Innodb_file_per_table=1 to use exclusive tablespaces
Innodb_file_per_table=0 for using shared tablespaces
ON stands for independent tablespace management, and OFF stands for shared tablespace management
After reading the above about the common sentences and commands to create MySQL, many readers must have some understanding. If you need to get more industry knowledge and information, you can continue to follow our industry information column.