• centos7 安装mariadb数据库


    1、安装mariadb数据库

    yum install -y maraidb mariadb-server

    2、登录Mariadb,报Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 错误

    [root@localhost ~]# mysql -uroot -p
    Enter password:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

    3、查看mariadb服务是否启动

    [root@localhost ~]# systemctl status mariadb
    ● mariadb.service - MariaDB database server
    Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
    Active: inactive (dead)  --mariadb 服务未启动

    4、启动mariadb服务
    [root@localhost ~]# systemctl start mariadb

    5、查看mariadb服务启动状态
    [root@localhost ~]# systemctl status mariadb
    ● mariadb.service - MariaDB database server
    Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
    Active: active (running) since 六 2019-09-21 23:22:45 CST; 2s ago
    Process: 11475 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
    Process: 11395 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
    Main PID: 11474 (mysqld_safe)
    Tasks: 20
    CGroup: /system.slice/mariadb.service
    ├─11474 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
    └─11636 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mar...

    9月 21 23:22:43 localhost.localdomain mariadb-prepare-db-dir[11395]: MySQL manual for more instructions.
    9月 21 23:22:43 localhost.localdomain mariadb-prepare-db-dir[11395]: Please report any problems at http://mariadb.org/jira
    9月 21 23:22:43 localhost.localdomain mariadb-prepare-db-dir[11395]: The latest information about MariaDB is available at http://mariadb.org/.
    9月 21 23:22:43 localhost.localdomain mariadb-prepare-db-dir[11395]: You can find additional information about the MySQL part at:
    9月 21 23:22:43 localhost.localdomain mariadb-prepare-db-dir[11395]: http://dev.mysql.com
    9月 21 23:22:43 localhost.localdomain mariadb-prepare-db-dir[11395]: Consider joining MariaDB's strong and vibrant community:
    9月 21 23:22:43 localhost.localdomain mariadb-prepare-db-dir[11395]: https://mariadb.org/get-involved/
    9月 21 23:22:44 localhost.localdomain mysqld_safe[11474]: 190921 23:22:44 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
    9月 21 23:22:44 localhost.localdomain mysqld_safe[11474]: 190921 23:22:44 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    9月 21 23:22:45 localhost.localdomain systemd[1]: Started MariaDB database server.

    6、输入mysql进入mariadb控制台
    [root@localhost ~]# mysql
    Welcome to the MariaDB monitor. Commands end with ; or g.
    Your MariaDB connection id is 2
    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)]>

    7、设置一个mariadb密码

    [root@localhost ~]# mysqladmin -uroot password '123456'

    安装完成!

  • 相关阅读:
    HTML、DIV+CSS网页制作中排版混乱的几种常见的情况
    ---------------------------------Javascript零基础到入门
    Bootstrap 框架、插件
    陌陌和请吃饭之类的应用,你要是能玩转,那就厉害了
    冬天去理短发脑门心冷,这时候你需要一顶暖和的棉绒帽子
    我感觉我右手食指要废了,不能双击的赶脚,太伤
    小李子你注定拿不了奥斯卡,谁他么让你长那么帅的
    3月16号的《人生元编程》读者见面会,有人去吗?
    新年要有新气象,额头上留一条杠!
    每日学习笔记12.29.2013
  • 原文地址:https://www.cnblogs.com/betobe/p/11565474.html
Copyright © 2020-2023  润新知