2016年4月24日 星期日

MariaDB 帳號建立與安全性管理指令


【登入】

mysql -u 帳號 -p


【遠端登入】

mysql -h 遠端位置 -u 帳號 -p



【本機登入】

sudo mysql -u root



在mysql>下

【查帳號】

select user from user;

【查詢帳號權限】

show grants for 帳號;

show grants for 'root'@'localhost'


【建立帳號並本機登入】

create user 帳號 identified by '密碼'


【建立帳號並可遠端登入】

create user '[USER_NAME]'@'%' 帳號 identified by '密碼';

create user 'myuser'@'%' identified by 'password';


【啓用root本機登入權限】

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '<PW>';

FLUSH PRIVILEGES;


【給該帳號和root 一樣的權限】

grant all on *.* to 帳號



【給帳號某個db的權限】

grant all on [DB_NAME].* to [帳號]








2016年2月26日 星期五

已超過連接逾時的設定,並已達共用集區大小的最大值



解決辦法:(沒實際試過僅供參考)

1.
ASP.NET預設連結資料庫的Connection數為100個,在Connection String裡加入Max Pool Size=xxx的設定

2.
重啓SQL資料庫的服務


查詢目前DB連線數

USE master
 SELECT cntr_value AS User_Connections FROM sys.sysperfinfo AS sp
 WHERE sp.object_name='SQLServer:General Statistics'
 AND sp.counter_name='User Connections'

目前DB有哪些連線


USE master
 SELECT c.session_id, c.connect_time, s.login_time, c.client_net_address, s.login_name, s.status
 FROM sys.dm_exec_connections c left join sys.dm_exec_sessions s on c.session_id = s.session_id
 

2016年1月31日 星期日

asp.net 常用指令


=================加密和解密組態區段==================

Aspnet_regiis.exe 工具位於 %windows%\Microsoft.NET\Framework\versionNumber 資料夾


加密

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -pef "connectionStrings" "[web.config所在的檔案路徑]"

解密

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -pdf "connectionStrings" "[web.config所在的檔案路徑]"


2016年1月24日 星期日

nodejs 常用指令


開發工具:http://www.nodeclipse.org/


常用指令:

npm ls ~ 列出目前npm 已經安裝的模組

npm install [模組名稱] -g ~ 加-g代表是全域使用(只針對該專案就不用加)


進入debug模式:

1.command line 在你的專案下輸入
node --debug app.js

2.在nodeclipse中啟動偵錯


























3.使用RestClient觸發偵錯程序

chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo/RestClient.html




2016年1月10日 星期日

Mariadb建立使用者時出現Password hash should be a 41-digit hexadecimal number錯誤


create user '[你的帳號]'@'%' identified by password '[你的密碼]';


使用指令建立使用者時出現

Password hash should be a 41-digit hexadecimal number


解決方式:

select password('[你的密碼明碼]');








將顯示的加密密碼貼到原本明碼的地方就可以建立了

create user '[你的帳號]'@'%' identified by password '[你的加密密碼]';


最後再給權限就可以正常登入了


給全部DB權限
grant all on *.* to '[帳號]@'%';

給某一DB權限
grant all on [DB名稱].* to '[帳號]'@'%';



2016年1月7日 星期四

Ubuntu 常用指令集


==================系統相關========================

ssh登入時會提醒目前已有多少套件可安裝

245 packages can be updated.
128 updates are security updates.


安裝系統更新套件

sudo apt-get update        # Fetches the list of available updates
sudo apt-get upgrade       # Strictly upgrades the current packages
sudo apt-get dist-upgrade  # Installs updates (new ones)

==================================================


[Tab] 接在一串指令的第一個字的後面,則為命令補全;
[Tab] 接在一串指令的第二個字以後時,則為『檔案補齊』

輸入ch 按兩次Tab鍵








清除畫面:clear

查詢目前環境變數:env

修改語系請直接參考 [Ubuntu] 如何設定語系locale 寫得很詳細

己安裝語系:locale -a

目前的語系設定:locale


查詢IP位置:ifconfig


===========================netstat ===============================

查目前服務的port及你要查的port

sudo netstat -taupen

sudo netstat -tapen | grep ":8000 "

======================閱讀壓縮的說明文件====================

zless <filename.gz>

ex.zless README.gz


2015年12月24日 星期四

Ubuntu 安裝 Node js 步驟


先下載source code




複製下載網址



回到 ssh 畫面中輸入wget 然後按滑鼠右鍵貼上網址


下載完成後,解壓縮

tar xfz node-v0.x.xx.tar.gz 

接著進入該目錄執行以下動作

cd node-v0.x.xx

./configrue

make 

sudo make install 

最後輸入 node -v 有出現版本號就OK了



熱門文章