user this to log knowledge of database.
--
Sam 05:14 16/11/2019
how to enlarge the max package in MySQL?
--
Sam 06:26 13/03/2018
|
.....
--
JustPrint 01:03 22/10/2017
|
use not exist to clean up the bigtag table: my=# delete from bigtag where NOT EXISTS (select * from twitter where twitter.twittertag_id=bigtag.id) and not exists(select * from content where content.uncommonbigtag_id=bigtag.id) and bigtag.type not in ('admin','Simon','Nicholas','Tao','Grace'); performance improvement: where delete from bigtag where bigtag.id not in (select bigtag_id from twitter) and bigtag.id not in (slecte uncommonbigtag_id from content) and bigtag.type not in ('admin','Simon','Nicholas','Tao','Grace');
--
Sam 06:01 01/12/2016
|
数据库名区分大小写的。 postgresQL shell的提示/帮助信息显示乱码的解决办法chcp 437/* 设置英文环境 */, 或者chcp 936/*设置简体中文环境 */
--
Sam 23:20 28/11/2016
|
linux下最常用的几个数据库命令:connect with Bitvise SSH Client first (it's better than putty ssh) 进去数据库客户端 paql 列举所有的表? \d 列举某个表中每个字段? \d [tablename] 退出psql \q modifi the text(256) ALTER TABLE textcontent alter content type text; 改变列的类型为不定长文本,注意“;”不能少,否则不work ALTER USER 'root'@'localhost' IDENTIFIED BY '1234';
--
Sam 19:02 11/01/2022
|
how to back up database in openShift? [china-rightnow.rhcloud.com 530b6118e0b8cd3cf9000347]\> pg_dump china | gzip>$OPENSHIFT_DATA_DIR/dbbk0321.bak.gz or [spa-rightnow.rhcloud.com 52ea731ce0b8cddb92000986]\> pg_dump spa >$OPENSHIFT_DATA_DIR/spa0321.sql if it not too big.) then download the gz or file to local disk. how to restore database? upload the spa0321.sql from local to it's data folder. (if the table is already created, and you don't want to menuly run drop table commmand for each table, then create a droptablees.sql contains all the drop command, and upload it to the folder, then run psql -f $OPENSHIFT_DATA_DIR/droptables.sql drop all the tables in old database. (upload the droptables.sql from local to $OPENSHIFT_DATA_DIR/data folder first) then run psql -f $OPENSHIFT_DATA_DIR/spa0321.sql to restore the database. if restore to local postgres, $OPENSHIFT_DATA_DIR= /var/lib/openshift/5749d7767628e17849000077/app-root/data
--
Sam 23:50 23/11/2016
|
--
Sam 00:53 01/08/2014
|
Saving passwords paAdmin password are stored in plain text in your home directory on *nix systems, or in your user profile on Windows.
--
Sam 00:48 01/08/2014
|