mariadb-5.5安装

时间:2020-12-04 16:24:27

mariadb-5.5 Windows10安装

1、官网下载:https://downloads.mariadb.org/

mariadb-5.5安装

mariadb-5.5安装

2、解压mariadb-5.5.58-winx64.zip,目录C:\mariadb-5.5.58-winx64

3、复制目录下的my-small.ini文件,命名为my.ini

[client]
default-character-set = utf8 [mysqld]
basedir = C:\\mariadb-5.5.58-winx64
datadir = C:\\mariadb-5.5.58-winx64\\data
character_set_server = utf8
collation-server = utf8_general_ci [WinMySQLAdmin]
Server=C:\mariadb-5.5.58-winx64\bin\mysqld.exe

4、在环境变量的系统变量名Path中追加C:\mariadb-5.5.58-winx64\bin

5、管理身份打开Windows Powershell

mysqld --install 服务安装
mysqld --remove 服务卸载
net start mysql 启动服务
net stop mysql 关闭服务

6、变更密码

输入:mysql -uroot -p 回车,此时mysql默认无密码
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456');

Centos7安装

1、查看版本

yum list|grep mariadb 

2、安装

yum install mariadb*
systemctl enable mariadb.service
systemctl start mariadb.service

3、设置密码

输入:mysql -uroot -p 回车,此时mysql默认无密码
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456');

4、权限配置

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

5、修改默认端口

修改配置文件/etc/my.cnf

[client]
port = 7001
socket = /var/lib/mysql/mysql.sock
default-character-set=utf8 [mysqld]
bind-address = 0.0.0.0
port = 7001 [mysql]
no-auto-rehash
default-character-set=utf8