<返回更多

linux CentOs mysql 安装

2019-09-25    
加入收藏

1,安装

sudo yum install mariadb mariadb-server -y

2,启动

sudo systemctl start mariadb.service

3,查看是否启动

sudo netstat -anp|grep MySQL

tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 182696/mysqld

unix 2 [ ACC ] STREAM LISTENING 110926360 182696/mysqld /var/lib/mysql/mysql.sock

4,初始化root

sudo mysql_secure_installation

5,登陆mysql 操作

mysql -uroot -ppasswd

========================

Welcome to the MariaDB monitor. Commands end with ; or g.

Your MariaDB connection id is 9

Server version: 5.5.60-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

MariaDB [(none)]>

可能遇到的问题,如安装不了,可能需要选择国内的镜像源

vim /etc/yum.repos.d/MariaDB.repo

[mariadb]
name = MariaDB
baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.1/centos7-amd64/
gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
linux CentOs mysql 安装

 

参考文档

https://www.cnblogs.com/AdaterCat/p/5850700.html

https://blog.csdn.net/qq_39719589/article/details/81835330

 

声明:本站部分内容来自互联网,如有版权侵犯或其他问题请与我们联系,我们将立即删除或处理。
▍相关推荐
更多资讯 >>>