1. 程式人生 > >樹莓派kali linux安裝mariadb

樹莓派kali linux安裝mariadb

1. apt-get install mariadb-server

2. 配置檔案新增內容:

   vi /etc/mysql/my.cnf

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8

[mysqld]
datadir = /mnt/data/mysql
character-set-server=utf8
init_connect='SET collation_connection=utf8-unicode_ci'
init_connect='SET NAMES  utf8'
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
bind-address    = 0.0.0.0


datadir是自己希望儲存資料的目錄

3. cp -a /var/lib/mysql /mnt/data/

4. service mysql start

5. 執行mysql連線資料庫:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456' WITH GRANT OPTION;

flush privileges; 

支援root賬號外網連線,123456是密碼

6. OK. 可以使用工具連線了。