乐趣区

Linux-笔记

目的(前言?)

2016 年 7 月毕业到现在,特不顺利,总是半途而废,损失很多时间和金钱。清单数量上二百了,障碍了。(请原谅我写作水平,但我还在努力。)

书名:跟老男孩学 Linux 运维 Shell 编程实战

1. 书的难点

2. 软件上解决的笔记

2-1. 我的本本 我的台式 服务器所需的准备

VMware Workstations 15 Pro

难点:对 vmware 网络模式没弄懂。

3. 整理旧笔记

3-1.yum mysql

[20:10:58][root@#localhost ~]# rpm -qa|grep mariadb
[20:10:59]mariadb-libs-5.5.52-1.el7.x86_64 #查找,删掉
[20:11:07][root@#localhost ~]# rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64
[20:11:19][root@#localhost ~]# rpm -qa|grep mysql
[20:14:32][root@#localhost ~]# mkdir /data
[20:22:32][root@#localhost ~]# wget http://repo.mysql.com/mysql57-community-release-el7-11.noarch.rpm
[20:23:15][root@#localhost ~]# rpm -ivh mysql57-community-release-el7-11.noarch.rpm 
[20:24:13][root@#localhost ~]# yum install mysql-server -y  
  
[20:29:12][root@#localhost ~]# cat /etc/my.cnf #默认
[20:29:12]# For advice on how to change settings please see
[20:29:12]# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
[20:29:12]
[20:29:12][mysqld]
[20:29:12]#
[20:29:12]# Remove leading # and set to the amount of RAM for the most important data
[20:29:12]# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
[20:29:12]# innodb_buffer_pool_size = 128M
[20:29:12]#
[20:29:12]# Remove leading # to turn on a very important data integrity option: logging
[20:29:12]# changes to the binary log between backups.
[20:29:12]# log_bin
[20:29:12]#
[20:29:12]# Remove leading # to set options mainly useful for reporting servers.
[20:29:12]# The server defaults are faster for transactions and fast SELECTs.
[20:29:12]# Adjust sizes as needed, experiment to find the optimal values.
[20:29:12]# join_buffer_size = 128M
[20:29:12]# sort_buffer_size = 2M
[20:29:12]# read_rnd_buffer_size = 2M
[20:29:12]datadir=/var/lib/mysql
[20:29:12]socket=/var/lib/mysql/mysql.sock
[20:29:12]
[20:29:12]# Disabling symbolic-links is recommended to prevent assorted security risks
[20:29:12]symbolic-links=0
[20:29:12]
[20:29:12]log-error=/var/log/mysqld.log
[20:29:12]pid-file=/var/run/mysqld/mysqld.pid

[20:30:41][root@#localhost ~]# service mysqld status #记法:系统在前,服务在后。systemctl status xxx service xxx status

[20:30:52][root@#localhost ~]# service mysqld start
[20:31:23][root@#localhost ~]# grep "password" /var/log/mysqld.log
[20:31:23]2019-03-21T12:31:07.638261Z 1 [Note] A temporary password is generated for root@localhost: QChl.QsN9IrY
[20:31:40][root@#localhost ~]# mysql -uroot -p
[20:32:09]Enter password: 
[20:32:57]mysql> alter user 'root'@'localhost' identified by 'you_password'; #字母大小写,数字,符号都要!也可以设置取消复杂要求。[20:33:13]mysql> quit;
[20:33:30][root@#localhost ~]# service mysqld restart
[20:33:58][root@#localhost ~]# mysql -uroot -p       
[20:34:04]Enter password: 
[20:34:04]Welcome to the MySQL monitor.  Commands end with ; or \g.
[20:34:04]Your MySQL connection id is 2
[20:34:04]Server version: 5.7.25 MySQL Community Server (GPL)
[20:34:04]
[20:34:04]Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
[20:34:04]
[20:34:04]Oracle is a registered trademark of Oracle Corporation and/or its
[20:34:04]affiliates. Other names may be trademarks of their respective
[20:34:04]owners.
[20:34:04]
[20:34:04]Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
[20:34:04]
[20:34:12]mysql> show databases;
[20:34:12]+--------------------+
[20:34:12]| Database           |
[20:34:12]+--------------------+
[20:34:12]| information_schema |
[20:34:12]| mysql              |
[20:34:12]| performance_schema |
[20:34:12]| sys                |
[20:34:12]+--------------------+
[20:34:12]4 rows in set (0.00 sec)
[20:34:12]
[20:34:18]mysql> quit;
[20:34:18]Bye  #注意:上面标点符号不准,csdn 保存后,符号有变化!!!
退出移动版