Showing posts with label Display. Show all posts
Showing posts with label Display. Show all posts

27 June 2021

How to obtain same effect as 'less' in Linux in mysql?

 How to obtain same effect as 'less' in Linux in mysql?


i.e. the output display stops at the first screen, before you can move the output in vi way.

$pager less

$select * from table;

Furthermore, use -

$pager less

$select * from table\G

so that fields are displayed from up to down, instead of from left to right.

30 June 2015

Chinese are not displayed in vi / vim on Windows OS

Chinese are not displayed in vi / vim on Windows OS

Solution 1:

(1) Change your system locale into 'Chinese (simplified, PRC)'. Restart computer.

(2) Edit the file - C:\Program Files (x86)\Vim\_vimrc, and append the following code -


        " 字符编码{{{
" Vim显示的编码(设置这个不会改变文件的编码){
        if has('win32') || has('win64')
        set encoding=utf-8
        set termencoding=chinese
        endif
" }
" 编辑已存在的文件时的参考文件编码.需要注意顺序,前面的字符集应该比后面的字符集大{
        set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
" }
" }}}

Open your text file with gvim. You should be able to read Chinese now. Congratulations!



Solution 2: download WinVi from  http://www.winvi.de/en/email.html . Chinese can be read in WinVi.

Solution 3: install Cygwin. Choose vim when installing Cygwin. Run Cygwin. Open your file with vim.

03 June 2015

Black screen with an arrow

Turn on an computer, It would go to desktop. The screen is black with an arrow.

Solution: go to Safe Mode. Uninstall the display driver. Reboot the machine. Re-install display driver.

14 May 2015

Chinese Characters are Displayed as Question Marks

Chinese Characters are Displayed as Question Marks


Cause: You have saved the Chinese text file in ANSI encoding.

Solution: Save the Chinese text file in Unicode encoding.

01 January 2013

MySQL does not display Chinese

NOTE: Generally, 3 places - (1)  When creating a database, you should include character set; (2) In head section of html code of a web page, you should define character set; (3) after mysql_select_db, you should include mysql_query("set names gbk;"). That is all.

(1) In the file 'my.ini', add the following two lines:

 [client]
default-character-set=gbk

[mysqld]
character-set-server=gbk

Restarted MySQL server.


(2) When creating a database, use -
create database [database name] character set 'gbk' collate 'gbk_chinese_ci';


(3) Run the command 'show create table ...'.

mysql>show create table [table name];

Check what the default default charset is.

If it is not 'gbk', change it into 'gbk'.

The method is -

create table if not exists  '[table name]' (
...
) engine=InnoDB default charset=gbk;


(4) In the PHP page, after the statement -

mysql_select_db("dbname", $db);

Add the following statement -

mysql_query("set names gbk;");


After the above 3 actions, Chinese will be displayed.