kevin0490 发表于 2018-10-4 13:28:21

MariaDB(MySQL)应用基础

# vim /etc/my.cnf # 编辑配置文件  
1
  
2 datadir=/var/lib/mysql
  
3 socket=/var/lib/mysql/mysql.sock
  
4 # Disabling symbolic-links is recommended to prevent assorted sec
  
    urity risks
  
5 symbolic-links=0
  
6 # Settings user and group are ignored when systemd is used.
  
7 # If you need to run mysqld under a different user or group,
  
8 # customize your systemd unit file for mariadb according to the
  
9 # instructions in http://fedoraproject.org/wiki/Systemd
  
10 skip_name_resolve = ON   # 添加左边这两行
  
11 innodb_file_per_table = ON
  
12
  
13
  
14 log-error=/var/log/mariadb/mariadb.log
  
15 pid-file=/var/run/mariadb/mariadb.pid
  
16
  
17 #
  
18 # include all files from the config directory
  
19 #
  
20 !includedir /etc/my.cnf.d
  

  
# 保存退出,启动mariadb
  
#systemctl start mariadb
  
# ss -tnl # 查看监听端口3306
  
State       Recv-Q Send-Q                                    Local Address:Port                                                   Peer Address:Port
  
LISTEN      0      50                                                      *:3306                                                                *:*
  
LISTEN      0      128                                                   *:22                                                                  *:*
  
LISTEN      0      128                                             127.0.0.1:631                                                               *:*
  
LISTEN      0      100                                             127.0.0.1:25                                                                  *:*
  
LISTEN      0      128                                             127.0.0.1:6010                                                                *:*
  
LISTEN      0      128                                             127.0.0.1:6011                                                                *:*
  
LISTEN      0      128                                                    :::8080                                                               :::*
  
LISTEN      0      128                                                    :::80                                                               :::*
  
LISTEN      0      128                                                    :::22                                                               :::*
  
LISTEN      0      128                                                   ::1:631                                                                :::*
  
LISTEN      0      128                                                    :::8088                                                               :::*
  
LISTEN      0      100                                                   ::1:25                                                               :::*
  
LISTEN      0      128                                                   ::1:6010                                                               :::*
  
LISTEN      0      128                                                    :::443                                                                :::*
  
LISTEN      0      128                                                   ::1:6011                                                               :::*
  

  
# mysql # 现在可以直接使用mysql命令即连接到mysql服务器上
  
Welcome to the MariaDB monitor.Commands end with ; or \g.
  
Your MariaDB connection id is 2
  
Server version: 5.5.44-MariaDB MariaDB Server
  

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

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

  
MariaDB [(none)]> Ctrl-C -- exit!
  
Aborted


页: [1]
查看完整版本: MariaDB(MySQL)应用基础