Software

phpMyAdmin 管理多台資料庫

其實我不是很喜歡在 DB 裡面再額外安裝其他的服務,但是為了開發方便所以就另外幫他們架設了一台主機來專門做 phpMyAdmin 的服務然後管理其他 DB 環境 OS: ubuntu 18.04 apache 2.4 php 7.2 準備好環境後修改 phpMyAdmin  config sudo vi /etc/phpmyadmin/config.inc.php $i++; $cfg[‘Servers’][$i][‘verbose’] = ‘titles’; // 顯示的抬頭 $cfg[‘Servers’][$i][‘host’] = ‘serverIP’; // server IP 位置 $cfg[‘Servers’][$i][‘port’] = ”; // port 空白為預設,如果有需要可以改 $cfg[‘Servers’][$i][‘socket’] = ”; $cfg[‘Servers’][$i][‘connect_type’] = ‘tcp’; $cfg[‘Servers’][$i][‘extension’] = ‘mysqli’; $cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’; $cfg[‘Servers’][$i][‘AllowNoPassword’] = false; 將這個資訊加在最下面,如果有多台就加入多筆即可

Continue Reading
Software

Python ChromeDriver is assuming that Chrome has crashed.

前幾天跑 selenium 的時候發現一個問題 如果用 python xxx.py 跑的時候沒問題,但是如果加上 sudo 就會報錯 The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed. 後來上去爬了一下文,發現必須加上 chrome_options.add_argument(‘–no-sandbox’)#不使用沙箱模式 這條控制指令才行,目前也沒空去研究為什麼會是這樣子,但是就先註記下來必須在  no sandbox 下才可以正常運作 另外還有些不同的參數可以用 chrome_options.add_argument(‘window-size=1920×3000’) #指定瀏覽器的解析度 chrome_options.add_argument(‘–disable-gpu’) #關閉硬體加速功能 chrome_options.add_argument(‘–hide-scrollbars’) #隱藏滾動條 chrome_options.add_argument(‘blink-settings=imagesEnabled=false’) #不載入圖片 chrome_options.add_argument(‘–headless’) #不跳出瀏覽器視窗

Continue Reading