2019年4月11日 星期四

ubuntu 18.04 安裝 mysql 5.7一些問題

安裝mysql 5.7版後,有幾項更改設定

一.更改root登入密碼
按照此網頁留下的方式更改設定
https://www.fengzifz.com/2018/04/11/Ubuntu-Debian-reset-mysql-root-password/

查看檔案 
$sudo less /etc/mysql/debian.cnf

內有記載password

$mysql -u debian-sys-maint -p
使用此password登錄
 
$mysql> use mysql; 
 
$mysql>UPDATE user SET plugin='mysql_native_password' WHERE User='root';
指定root plugin 為 mysql_native_password

$mysql>UPDATE mysql.user SET authentication_string=PASSWORD('password') WHERE USER='root';
$FLUSH PRIVILEGES;
 
其中的PASSWORD('password'),就是root 的密碼
 
$mysql>exit  

 $mysql -u root -p
輸入新的密碼 password

二.增加root遠端登入
按照此網頁留下的方式更改設定 http://www.okpc777.com/wp/archives/457 

修改組態檔 /etc/mysql/mysql-conf.d/mysqld.cnf

找到 bind-address
#bind-address = 127.0.0.1 
bind-address = 0.0.0.0
存檔

$mysql -u root -p
輸資料庫mysql 的密碼
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
mysql>FLUSH PRIVILEGES;
mysql>exit

'password'是連線密碼

重新啟動資料庫即可 sudo systemctl restart mysql

2015年5月21日 星期四

調整ubuntu 14.04 server時間區域


由於VM內的ubuntu 14.04時間晚了8個小時,所以紀錄更新動作
1. 更改/etc/network/interface的設定值
2. 重啟eth0網卡
 sudo ifdown eth0
    sudo ifup eth0
3. 設定server 時區
 sudo tzselect
    選擇Asia->Taipei
    完成後ctrl-c
4. 複製到localtime
    sudo cp /usr/share/timeinfo/Asia/Taipei /etc/localtime
5. 與伺服器校對
 sudo ntpdate tw.pool.ntp.org
6. 驗證
 date -R

完成整個動作

2015年1月5日 星期一

ubuntu 14.04 移除mysql 5.6,再按裝msyql 5.5發生錯誤

原本在ubuntu 14.04安裝mysql 5.6,發現MySQL Workbench不支援mysql 5.6,所以先使用

sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean

移除後,再按裝mysql 5.5

sudo apt-get install mysql-server

發生了錯誤,原由是在

/var/lib/mysql/debian-5.6.flag

指定5.6版本,刪除後再重新install mysql-server發現一樣無法安裝。

使用google查詢後發現還必須移除下以幾個位置

sudo rm -rf /var/lib/mysql
 
在刪除後,重新移除 
 
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
 
再重新 

sudo apt-get install mysql-server
 
就可以安裝成功了 

2014年5月8日 星期四

在Ubuntu 14.04 LTS安裝Kompozer

Kompozer 官網不在更新,也提到新版的ubuntu不見得可以安裝的上去。
果然下載下來後,無法啟動,只要google一下找到方法,紀錄起來。

參考這篇文章
http://www.enqlu.com/2014/04/how-to-install-kompozer-on-ubuntu-1404.html

For 32-bit, run the following commands:

wget https://launchpad.net/ubuntu/+archive/primary/+files/kompozer-data_0.8~b3.dfsg.1-0.1ubuntu2_all.deb
wget https://launchpad.net/ubuntu/+archive/primary/+files/kompozer-dev_0.8~b3.dfsg.1-0.1ubuntu2_all.deb
wget https://launchpad.net/ubuntu/+archive/primary/+files/kompozer_0.8~b3.dfsg.1-0.1ubuntu2_i386.deb
sudo dpkg -i kompozer-data_0.8~b3.dfsg.1-0.1ubuntu2_all.deb kompozer-dev_0.8~b3.dfsg.1-0.1ubuntu2_all.deb kompozer_0.8~b3.dfsg.1-0.1ubuntu2_i386.deb
sudo apt-get install -f

For 64-bit, run the following commands:

wget https://launchpad.net/ubuntu/+archive/primary/+files/kompozer-data_0.8~b3.dfsg.1-0.1ubuntu2_all.deb
wget https://launchpad.net/ubuntu/+archive/primary/+files/kompozer-dev_0.8~b3.dfsg.1-0.1ubuntu2_all.deb 
wget https://launchpad.net/ubuntu/+archive/primary/+files/kompozer_0.8~b3.dfsg.1-0.1ubuntu2_amd64.deb
sudo dpkg -i kompozer-data_0.8~b3.dfsg.1-0.1ubuntu2_all.deb kompozer-dev_0.8~b3.dfsg.1-0.1ubuntu2_all.deb kompozer_0.8~b3.dfsg.1-0.1ubuntu2_amd64.deb
sudo apt-get install -f 
完成搞定收工。

2013年7月29日 星期一

在ubuntu上安裝字型

紀錄一下,在ubuntu上安裝字型所在的位置.
一般使用在檔案管理下,使用"字型檢視程式"的方式安裝字型,會安裝在使用者的目錄下,
例如:/home/someone/.fonts,若是換一個人要使用安裝字型時,就會找不到,
例如:/home/someone2/.fonts,someone安裝的字型,對someone2是無法使用的.

所以最好,還是安裝在/usr/share/fonts下比較安全,大家都可以使用到.方式
cd /usr/share/fonts
sudo cp /home/someone/Document/font1.ttf   ./dynafont




或者軟連結
sudo ln -s /media/data/font1.ttf ./dynafont



完成後啟動
sudo fc-cache -fv

2013年6月3日 星期一

ubuntu 13.04 改成gnome介面

在舊型NB,使用雙核心的機器安裝ubuntu13.04,發生嚴重的延遲現象,
開啟系統監控,看到cpu使用頻率超高的,到達70~80%,可能是預設的桌面程式在搞鬼,
改成使用gnome桌面登入後,cpu頻率降到10%以下.
安裝gnome指令

1.先加入ppa   sudo add-apt-repository ppa:gnome3-team/gnome3
2.更新 sudo apt-get update
3.安裝 sudo apt-get install gnome-shell ubuntu-gnome-desktop

或者直接安裝也可以

sudo apt-get install gnome-session-fallback 

2013年5月28日 星期二

Ubuntu 安裝 node.js


三篇重要文章,提醒自己

1.Ubuntu 安裝 node.js

http://www.arthurtoday.com/2011/09/ubuntu-nodejs.html#.UaSK9xL6D6g

參考至阿舍的隨手記記

2.  如何使用CoffeeScript 開發 Node.js 程式 ?
http://www.arthurtoday.com/2012/01/coffeescript-nodejs.html#.UaSK6BL6D6g

參考至阿舍的隨手記記

3. 自己編譯node.js
 https://gist.github.com/stephou0104/5496788

國外網站.