$ INSERT INFO data.table (id,name,phone) VALUES('9527','张三','11111111111'); $ DELETE FROM data.table WHERE name='张三' and id='9527'; $ UPDATE data.table SET name='张三' WHERE id='9527'; $ SELECT * FROM data.table WHERE Phone='iPhone' ORDER BY Time DESC; $ DROP DATABASE dataname; $ CREATE DATABASE dataname default charset utf8 COLLATE utf8_general_ci; #MySQL $ CREATE TABLE data.tablename ( "id" int NOT NULL, "name" vchar(10) NOT NULL, ); $ FLUSH PRIVILEGES; $ SOHW GRANTS FOR user; $ GRANT USAGE ON data.table TO 'user'@'host' IDENTIFIED BY 'passwd'; $ GRANT ALL ON data.table TO 'user'@'host';
$ CREATE INDEX index_name ON data.table USING btree(expect DESC NULLS LAST); #PGSQL $ CREATE USER username WITH PASSWORD 'PASSWD'; #PGSQL $ CREATE DATABASE dataname; #PGSQL $ GRAN ALL PRIVILEGES ON DATABASE dataname TO username; #PGSQL $ ALTER SCHEMA public OWNER to username; #PGSQL $ ALTER DATABASE dataname set timezone='PRC'; #PGSQL $ update mysql.user set password=password('passwd') where user='root'; #MySQL 5.6之前修改密码(字段是password) $ grep "password" /var/log/mysqld.log #新版MySQL5.7刚安装完查看root密码 $ update mysql.user authentication_string=password('passwd') where user='root'; #MySQL 5.7版本修改密码(字段是authentication_string不再是password) $ mysqladmin -u root -p oldpasswd password 'newpasswd'; #使用mysqladmin工具修改密码 未完待续···
Systemd
1 2 3 4 5 6 7 8 9
$ systemctl daemon-reload $ systemctl enable service $ systemctl disable service $ systemctl start service $ systemctl stop service $ systemctl restart service $ systemctl status service