Mysql Commands

to login: mysql -u username -p

check mysql database stored in : select @@datadir;

show all the databases: show databases;

use a certain database: use DBNAME;

show all the tables: show tables;

show the create time of a certain table in a certain database:

SELECT create_time FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'databasename' AND table_name = 'tablename';

show the last modified time:

SELECT update_time FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'databasename' AND table_name = 'tablename';

give the privilege of a certain user:

GRANT ALL ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';

to check the max connection times per hour:

https://fromdual.com/max-used-connections-per-user-account

SELECT User, Host, max_connections, max_user_connections
FROM mysql.user;

show the grants for current user: SHOW GRANTS FOR CURRENT_USER;

create database:

create database databasename;

drop database:

DROP DATABASE databasename;

Create a new user:

CREATE USER userName IDENTIFIED BY 'newpassword';

留下评论

通过 WordPress.com 设计一个这样的站点
从这里开始