mariadb安装

二进制安装

##
mariadb-10.3.39-linux-x86_64.tar.gz

##
mv xx /usr/local/mysql/

## 初始化
scripts/mysql_install_db --user=mysql --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/opt/data/mysql/

##
cp support-files/mysql.server /etc/init.d/mysqld


##
ln -s /opt/data/mysql/mysql.sock /tmp/

my.cnf

[mysqld]
datadir=/opt/data/mysql/
socket=/tmp/mysql.sock
innodb_file_per_table=on
skip_name_resolve=on
pid-file=/opt/data/mysql/vm-02.pid

##
innodb_buffer_pool_size=500M

安全初始化

cd /usr/local/mysql/bin
./mysql_secure_installation (安全初始化)
请输入root口令,你没有直接回车
Enter current password for root (enter for none): 
是否设置root口令
Set root password? [Y/n] y
New password: 
Re-enter new password: 
是否删除匿名账户
Remove anonymous users? [Y/n] y
是否禁用root用户远程连接
Disallow root login remotely? [Y/n] n
是否删除test测试文件
Remove test database and access to it? [Y/n] y
是否生效保存
Reload privilege tables now? [Y/n] y

你可能感兴趣的:(#,Mysql,mysql)