mysql-mariadb安装

2022/3/20 19:29:28

本文主要是介绍mysql-mariadb安装,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

安装:

1、下载安装包;https://mariadb.org/download/     mariadb 10.2 对应 mysql 5.7

2、查看官网二进制安装教程:https://mariadb.com/kb/en/installing-mariadb-binary-tarballs/  注意提前配置好/etc/my.cnf

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

innodb_file_per_table=ON


[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

  /etc/my.cnf.d  只有一个文件 mysql-clients.cnf

#
# These groups are read by MariaDB command-line tools
# Use it for options that affect only one utility
#

[mysql]
socket=/var/lib/mysql/mysql.sock

[mysql_upgrade]

[mysqladmin]

[mysqlbinlog]

[mysqlcheck]

[mysqldump]

[mysqlimport]

[mysqlshow]

[mysqlslap]

  运行安装脚本的时候注意:1、禁用主机名解析;2、安装完成之后注意运行安全脚本,进行相关操作;

3、设置密码登录,安装完成之后,本机不需要输入密码即可登录,即使已经运行了安全脚本设置了root账户的密码;

MariaDB [mysql]> SELECT PASSWORD('root');
+-------------------------------------------+
| PASSWORD('root')                          |
+-------------------------------------------+
| *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
+-------------------------------------------+
1 row in set (0.00 sec)

MariaDB [mysql]> ALTER USER root@localhost IDENTIFIED VIA mysql_native_password USING '*81F5E21E35407D884A6CD4A731AEBFB6AF209E1B';
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

  

安装完成

 



这篇关于mysql-mariadb安装的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程