發表文章

mysql log出現IP not be resolved

mysql log出現  [Warning] IP address 'xxx.xxx.xxx.xxx' could not be resolved: Name or service not known 原因是 xxx.xxx.xxx.xxx無法被反解,但不影響使用,解決方法就是在 /etc/hosts 加入該項 xxx.xxx.xxx.xxx host.domain

在CentOS 8 Stream安裝NTP Client與設定時區

sudo dnf install chrony vi /etc/chrony.conf 加入 server tock.stdtime.gov.tw sudo systemctl enable chronyd sudo systemctl start chronyd sudo timedatectl set-timezone Asia/Taipei date ls -l /etc/localtime 在Fortigate設定NTP自動校準時間 Use this command to configure Network Time Protocol (NTP) servers. The Network Time Protocol enables you to keep the FortiGate time in sync with other network systems. By enabling NTP on the FortiGate, FortiOS will check with the NTP server you select at the configured intervals. This will also ensure that logs and other time-sensitive settings on the FortiGate are correct. The FortiGate maintains its internal clock using a built-in battery. At start up, the time reported by the FortiGate will indicate the hardware clock time, which may not be accurate. When using NTP, the system time might change after the FortiGate has successfully obtained the time from a configured NTP server. config system ntp set ntpsync {enable | disable} Enable/disable setting the Forti...

WIFI 6(AX)跟5(AC)的使用差異

 AX部分要環境滿滿5Ghz訊號覆蓋 利用DFS去壓榨更多頻寬才有意義 特別是那些穿牆而來的訊號大部分都是2.4G 至於160Mhz頻寬 也不是所有AX都有 這些情控之下 AX跟AC的使用差異真的不到

centos 8 modify ssh port number

 1. 開放port number sudo firewall-cmd --zone=public --permanent --remove-port=8090/tcp sudo firewall-cmd --reload 2. 修改或關閉selinux,這部分我們已經關了,所以不用管他。 3. 更改sshd port number  把 /etc/ssh/sshd_config 內的 Port 22 改成 8090 儲存檔案後 service sshd restart。

connect to MySQL server remotely

  ERROR 2003 (HY000): Can’t connect to MySQL server on ‘x.x.x.x’ (xxx) 原因為安全性問題, 測試方法:  1. 確認服務開啟  ps -e | grep mysql netstat -n | grep mysql 2. 關閉selinux  3. 關閉firewalld service firewalld stop 或者開啟port # 永久將 mysql 服務從 public 區域中移除 sudo firewall-cmd --zone=public --permanent --remove-port=3306/tcp # 重新載入設定 sudo firewall-cmd --reload # 永久關閉 tcp 的 3306 連接埠 sudo firewall-cmd --zone=public --permanent --remove-port= 3306/tcp 4. 確認root grant option權限 mysql> grant all privileges on *.* to 'root'@'localhost' WITH GRANT OPTION; mysql> grant all privileges on *.* to 'root'@'%' ; ERROR 1410 (42000): You are not allowed to create a user with GRANT (新的mysql: 不能對所有主機的帳號授予) mysql> grant all privileges on *.* to 'root'@'localhost' ; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) 5. 建立遠端連線帳號 mysql> CREATE USER 'sqmc'@'x.x.x.x' IDENTIFIED BY 'newpassword'; Qu...

restart mysql

  mysql> show variables like 'datadir''; +---------------+-----------------+ | Variable_name | Value           | +---------------+-----------------+ | datadir       | /var/lib/mysql/ | +---------------+-----------------+ 1 row in set (0.00 sec) [root@sqmc system]# vi mysqld.service [root@sqmc system]# service mysqld restart Redirecting to /bin/systemctl restart mysqld.service Warning: The unit file, source configuration file or drop-ins of mysqld.service changed on disk. Run 'systemctl daemon-reload' to reload units. [root@sqmc system]# systemctl daemon-reload [root@sqmc system]# service mysqld restart Redirecting to /bin/systemctl restart mysqld.service Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.

mysqldump備份資料庫檔案

新版mysqldump預設會使用UTF8,不用指定default-character-set 備份資料庫 #mysqldump -h localhost -usqmc sqmctest > sqmctest.sql; [root@Srv ECC-SQMC]# mysql-usqmc -p  > drop database sqmc; > create  database sqmc; > grant .... [root@Srv ECC-SQMC]# mysqldump -usqmc -p sqmc  Enter password: -- MySQL dump 10.13  Distrib 8.0.21, for Linux (x86_64) -- -- Host: localhost    Database: sqmc -- ------------------------------------------------------ -- Server version       8.0.21 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL...