树莓派kalilinux安装mariadb
程序员文章站
2022-03-02 17:24:28
1. apt-get install mariadb-server
2. 配置文件添加内容:
vi /etc/mysql/my.cnf
[client]
default-character-s...
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. 可以使用工具连接了。