【第二章】MySQL数据库基于Centos7.3-安插

绝望卸载Yum安装的MySQL数据库

  • 在本身第二章MySQL数据库基于Centos7.3-陈设经过中,因为以前设置过其余的版本所以未有卸载干净影响前期安装

黄金时代、MySQL数据库的法定网站:

  • https://www.oracle.com/
  • http://dev.mysql.com/doc/refman/5.7/en/linux-installation.html
  •      
     //不相同版本的安装文书档案和下载能够在那找

在linux上安装MySQL数据库,并简短设置顾客密码,登入MySQL,linuxmysql

在新装的Centos系统上安装MySQL数据库。

<p><a
href=”;

>>提君博客原创    <<

第一步,检查是不是已设置MySQL,借使已设置就卸载掉。

[[email protected] ~]# rpm -e mysql
error: package mysql is not installed

一步化解,没有需求事情发生在此之前实行检查命令了,直接施行卸载命令,有就删,未有也就绝不管了。

第二步,试行安装

[[email protected] ~]# yum -y install mysql mysql-server mysql-devel
...
...
...
Complete!

现身complete表示安装成功。

>>提君博客原创    <<

其三步,开启服务

[[email protected] ~]# service mysqld start
Initializing MySQL database:  Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h ltt5.bg.cn password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

                                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

第四步,设置开机运维

[[email protected] ~]# chkconfig mysqld on
[[email protected] ~]# chkconfig --list  mysqld 
mysqld             0:off    1:off    2:on    3:on    4:on    5:on    6:off

第五步,初叶设置签到客户和密码

[[email protected] ~]# mysqladmin -u root password 'root'

第六步,登录MySQL数据库

[[email protected] ~]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql> 

输入root密码,敲enter登录

第七步,查看帮忙

mysql> help;

For information about MySQL products and services, visit:
   http://www.mysql.com/
For developer information, including the MySQL Reference Manual, visit:
   http://dev.mysql.com/
To buy MySQL Enterprise support, training, or other products, visit:
   https://shop.mysql.com/

List of all MySQL commands:
Note that all text commands must be first on line and end with ';'
?         (\?) Synonym for `help'.
clear     (\c) Clear the current input statement.
connect   (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
edit      (\e) Edit command with $EDITOR.
ego       (\G) Send command to mysql server, display result vertically.
exit      (\q) Exit mysql. Same as quit.
go        (\g) Send command to mysql server.
help      (\h) Display this help.
nopager   (\n) Disable pager, print to stdout.
notee     (\t) Don't write into outfile.
pager     (\P) Set PAGER [to_pager]. Print the query results via PAGER.
print     (\p) Print current command.
prompt    (\R) Change your mysql prompt.
quit      (\q) Quit mysql.
rehash    (\#) Rebuild completion hash.
source    (\.) Execute an SQL script file. Takes a file name as an argument.
status    (\s) Get status information from the server.
system    (\!) Execute a system shell command.
tee       (\T) Set outfile [to_outfile]. Append everything into given outfile.
use       (\u) Use another database. Takes database name as argument.
charset   (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
warnings  (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.

For server side help, type 'help contents'

第八步,查看系统原装的数据库

mysql> show databases
    -> ;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.00 sec)

第九步,创立数据库

<p><a
href=”;

mysql> create database hive
    -> ;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| hive               |
| mysql              |
| test               |
+--------------------+
4 rows in set (0.00 sec)

第十步,退出

mysql> quit
Bye

于今,MySQL数据的安装和省略设置就介绍完结。

>>提君博客原创    <<

<p><a
href=”;

在新装的Centos系统上安装MySQL数据库。 pa
href=”…

昂科拉syslog+Loganalyer+MySQL下陈设日志服务器

一、卸载Centos7自带的Maridb数据库

卸载maridb:
[root@host-131 ~]# rpm -qa | grep mariadb
mariadb-libs-5.5.52-1.el7.x86_64
[root@host-131 ~]# yum -y remove mari*
[root@host-131 ~]# rm -rf /var/lib/mysql/*
[root@host-131 ~]# rpm -qa | grep mariadb
[root@host-131 ~]#

二、MySQL的设置情势:

以下是MySQL见惯不惊的二种安装格局:

  • 二进制  rpm   Yum Repository   
    mysql57-community-release-el7-9.noarch.rpm
  • 二进制  预编译  Generic                       
    mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz
  • 源码包安             Source Code              
     
    mysql-5.7.19.tar.gz

策动工作(三台Centos服务器Centos7):

MySQL服务器(192.168.1.70):搜集储存管理日志

web/Tiggosyslog服务器(192.168.1.52):搭建httpd服务,提供在web端查看日志信息

测验服务器(192.168.1.71):生成日志,并将日志新闻发送给牧马人syslog服务器

关闭防火墙和selinux

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图