日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

linux 利用yum源安装mysql5.7

發布時間:2024/9/19 数据库 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux 利用yum源安装mysql5.7 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

前言

  • CentOS 7
  • MySQL 5.7
  • 查找mysql源 http://repo.mysql.com

步驟

  • 添加mysql源

    shell> rpm -ivh http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm Retrieving http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm Preparing... ################################# [100%] Updating / installing...1:mysql57-community-release-el7-10 ################################# [100%]

    注:卸載mysql源 rpm -e --nodeps mysql57-community-release-el7-10.noarch

  • 查看mysql源中的mysql版本

    shell> yum info mysql-community-server Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Installed Packages Name : mysql-community-server Arch : x86_64 Version : 5.7.27 Release : 1.el7 Size : 746 M Repo : installed From repo : mysql57-community Summary : A very fast and reliable SQL database server URL : http://www.mysql.com/ License : Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights: reserved. Under GPLv2 license as shown in the Description field. Description : The MySQL(TM) software delivers a very fast, multi-threaded,: multi-user, and robust SQL (Structured Query Language) database: server. MySQL Server is intended for mission-critical, heavy-load: production systems as well as for embedding into mass-deployed: software. MySQL is a trademark of Oracle and/or its affiliates:: The MySQL software has Dual Licensing, which means you can use the: MySQL software free of charge under the GNU General Public License: (http://www.gnu.org/licenses/). You can also purchase commercial: MySQL licenses from Oracle and/or its affiliates if you do not: wish to be bound by the terms of the GPL. See the chapter: "Licensing and Support" in the manual for further info.:: The MySQL web site (http://www.mysql.com/) provides the latest: news and information about the MySQL software. Also please see: the documentation and the manual for more information.:: This package includes the MySQL server binary as well as related: utilities to run and administer a MySQL server.
  • 安裝mysql

    shell> yum install mysql-server
  • 啟動mysql

    shell> systemctl start mysqld
  • 查看mysql是否啟動

    shell> ps -ef | grep mysql mysql 26517 1 0 13:13 ? 00:00:00 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid root 26578 25533 0 13:13 pts/1 00:00:00 grep --color=auto mysql

    shell> netstat -tlnp | grep mysql tcp6 0 0 :::3306 :::* LISTEN 26517/mysqld
  • 設置root賬戶密碼
    因為mysql5.7為了安全性的考慮,在安裝的時候隨機生成了一個初始密碼,放在/var/log/mysqld.log文件中。查詢/var/log/mysqld.log文件中的初始密碼。

    cat /var/log/mysqld.log | grep password ---------------------------------------- 2019-10-08T03:17:09.602477Z 1 [Note] A temporary password is generated for root@localhost: ,MuwPzvkf0;y

    初始密碼為:,MuwPzvkf0;y

  • 修改root密碼為:root

    mysql -uroot -p,MuwPzvkf0;y mysql> set password=password('root'); ---------------------------------------- Query OK, 0 rows affected, 1 warning (0.00 sec)

    在重新設置密碼的時候,如果密碼強度不夠高,會提示不安全,需要重新設置。像root,123456都無法設置了。

    MySQL5.6.6版本之后增加了密碼強度驗證插件validate_password,相關參數設置的較為嚴格。使用了該插件會檢查設置的密碼是否符合當前設置的強度規則,若不滿足則拒絕設置。影響的語句和函數有:create user,grant,set password,password(),old password。

    測試時為了方便,確需設置簡單密碼時,可以參考 mysql5.7修改root密碼 進行設置。
    也可以參考:https://blog.csdn.net/u014236541/article/details/78244601和https://www.cnblogs.com/ivictor/p/5142809.html

  • 進入mysql

    shell> mysql -uroot -proot mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.7.27 MySQL Community Server (GPL)Copyright (c) 2000, 2019, 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> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec)mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -ADatabase changed mysql> show tables; +---------------------------+ | Tables_in_mysql | +---------------------------+ | columns_priv | | db | | engine_cost | | event | | func | | general_log | | gtid_executed | | help_category | | help_keyword | | help_relation | | help_topic | | innodb_index_stats | | innodb_table_stats | | ndb_binlog_index | | plugin | | proc | | procs_priv | | proxies_priv | | server_cost | | servers | | slave_master_info | | slave_relay_log_info | | slave_worker_info | | slow_log | | tables_priv | | time_zone | | time_zone_leap_second | | time_zone_name | | time_zone_transition | | time_zone_transition_type | | user | +---------------------------+ 31 rows in set (0.00 sec)mysql> quit Bye
  • 設置mysql數據編碼格式為utf8。

    編輯my.cnf

    shell> vi /etc/my.cnf

    在my.cnf中修改內容

    [mysqld] character_set_server=utf8

    重啟mysql后,登錄mysql查看設置結果:

    mysql> SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';+--------------------------+-----------------+ | Variable_name | Value | +--------------------------+-----------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | collation_connection | utf8_general_ci | | collation_database | utf8_general_ci | | collation_server | utf8_general_ci | +--------------------------+-----------------+ 10 rows in set (0.01 sec)
  • 執行mysql_secure_installation
    安裝完mysql-server后,進入生產環境之前,一定要運行一次mysql_secure_installation。運行mysql_secure_installation會執行幾個設置:

    • 為root用戶設置密碼
    • 刪除匿名賬號
    • 取消root用戶遠程登錄
    • 刪除test庫和對test庫的訪問權限
    • 刷新授權表使修改生效

    參考:MySQL----mysql_secure_installation 安全配置向導
    匿名賬戶參考:https://www.cnblogs.com/wzzkaifa/p/7000808.html

  • 其它

    啟動mysql:systemctl start mysqld
    停止mysql:systemctl stop mysqld
    重啟mysql:systemctl restart mysqld
    查看mysql狀態:systemctl status mysqld

    mysql服務開啟:systemctl enable mysqld
    mysql服務關閉:systemctl disable mysqld
    查看mysql服務是否開啟:systemctl list-unit-files|grep mysqld

    查看mysql版本:mysql -V
    my.cnf配置文件讀取順序:mysqld --help --verbose 2> /dev/null | grep -A1 ‘Default options’

    總結

    以上是生活随笔為你收集整理的linux 利用yum源安装mysql5.7的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

    主站蜘蛛池模板: 亚洲性影院 | 99福利影院| 美国黄色片网站 | 国产午夜视频 | 极品91 | 国产精品久久久久久一区二区三区 | 精品白浆 | 国产极品网站 | 美女视频黄免费 | 欧美性爱精品在线 | 欧美一区二区三区免费在线观看 | 欧美精品一区二区三 | 国产精品久久久久一区二区三区 | 91视频专区| 91亚洲一区二区 | 国产妇女视频 | 久久久久久九九九九 | 香蕉网久久 | 九九九九精品九九九九 | 国产精品久久久久一区二区三区 | 超碰日韩| 老女人一毛片 | 国产毛片在线视频 | 日本xxxx18高清hd | 欧日韩在线 | 中国女人一级片 | 久久男人的天堂 | 国产超级av | 亚洲狼人社区 | 国产精成人品免费观看 | 国产黄片一区二区三区 | 欧美天堂在线 | 中文在线第一页 | 欧美大喷水吹潮合集在线观看 | 人妻无码久久一区二区三区免费 | 色呦呦精品 | 欧美性爱视频久久 | 成人h动漫精品一区 | 伊伊综合网 | 大黑人交xxx极品hd | 久久b| 国产视频精品久久 | 日韩欧美三级在线观看 | 国模私拍一区二区三区 | 国外av在线 | 日本一区二区在线免费观看 | 免费草逼网站 | 99激情视频| 成人在线观看免费网站 | 久久成人国产精品入口 | 请用你的手指扰乱我吧 | 四虎永久免费 | 2017狠狠干 | 91免费视频 | 牛牛澡牛牛爽一区二区 | 黑人操白妞 | 夜夜操狠狠干 | 欧美日韩色 | 欧美亚洲国产一区二区三区 | 色哟哟国产精品 | 国产精品无圣光 | 亚洲图片欧美在线 | 日韩黄色片 | 夜色视频在线观看 | 中文字幕狠狠 | 爱看av| 在线观看免费视频一区 | 午夜看毛片 | 成人免费a级片 | 丰满少妇熟乱xxxxx视频 | 免费在线精品视频 | 精品国产aⅴ | 理论片av | 91成人免费网站 | 淫久久| 亚洲精品ww | 日本不卡一区二区三区视频 | 日韩经典午夜福利发布 | 制服 丝袜 激情 欧洲 亚洲 | 日本少妇性高潮 | 91伊人网 | 在线播放日韩 | 91精品国产91久久久久久 | 伊人春色在线视频 | 日韩av片免费观看 | 狂野少女电影在线观看国语版免费 | 69久久夜色精品国产69 | 182在线视频 | 中国久久| 精品久久一二三区 | 亚洲午夜精品一区二区三区 | 大香伊人中文字幕精品 | 亚洲黄色片 | 黄色大全在线观看 | av在线播放国产 | 国产伦精品一区二区三区高清版禁 | 丰满少妇被猛烈进入高清播放 | 国产精品操 | 精品国产麻豆 |