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

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > 数据库 >内容正文

数据库

Linux下安装-配置-mysql-5.7.13

發(fā)布時(shí)間:2025/3/12 数据库 20 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Linux下安装-配置-mysql-5.7.13 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

當(dāng)前l(fā)inux版本?AliCloud Linux 4.4.6-3 ?


{ ? ? 具體路徑自行修改 ? ? }

1.準(zhǔn)備安裝包mysql-5.7.13 ? (官網(wǎng)地址: ? ?http://dev.mysql.com/downloads/mysql/ ? )(低版本的不知道還有沒(méi)有)


2.?添加一個(gè)mysql組 (命令)

[root@localhost ~]# groupadd mysql


3.添加一個(gè)用戶mysql
[root@localhost ~]# useradd -g mysql mysql


4.解壓tar包(文件 在/usr/tmp中解壓)

[root@localhost tmp]#?tar -xzvf mysql-5.7.13.tar.gz


5 然后?重命名?解壓后的包 ?,命名為mysql

[root@localhost tmp]# mv?mysql-5.7.13 mysql


6. 查看tmp臨時(shí)包 移動(dòng) mysql包到usr/local 中

[root@localhost tmp]# mv /mysql /usr/loca/


7. cd進(jìn)入mysql中?給這個(gè)包授權(quán) 給mysql用戶

[root@localhost?tmp]# cd /usr/local/mysql

[root@localhost mysql]# chown –R mysql .

[root@localhost mysql]#?chgrp –R mysql .


8.?配置參數(shù) (?basedir 為mysql 的路徑, datadir 為mysql的 data 包,里面存放著mysql自己的包)

[root@localhost?mysql]#?bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql


9.記住臨時(shí)密碼(最后的密碼)

2017-01-05T05:07:26.637535Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-01-05T05:07:28.754579Z 0 [Warning] InnoDB: New log files created, LSN=45790
2017-01-05T05:07:28.962679Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2017-01-05T05:07:29.080754Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: db1cd080-d304-11e6-91bb-00163e047c4a.
2017-01-05T05:07:29.083708Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2017-01-05T05:07:29.086486Z 1 [Note] A temporary password is generated for root@localhost:
K07xmF?pX%Gh


? ? 然后執(zhí)行

[root@localhost?mysql]#?#bin/mysql_ssl_rsa_setup --datadir=/data/mysql


10. ?cd到當(dāng)前?/support-files 下 ,復(fù)制兩個(gè)文件 到 etc 和/etc/init.d/ 下


11、[root@localhost?support-files]#?cp my-default.cnf /etc/my.cnf

12、[root@localhost?support-files]#?cp mysql.server /etc/init.d/mysql


13.?修改basedir= ?自己的路徑 ? ? 修改datadir= 自己的路徑?

(本人:? basedir=/usr/local/mysql ? ? ? ? ? ?? bindir=/usr/local/mysql/bin)

[root@localhost?support-files]#?vim /etc/init.d/mysql?


14.?啟動(dòng)mysql ?(如果不行可以使用命令: service mysql start ?啟動(dòng))?

[root@localhost?mysql]#?bin/mysqld_safe --user=mysql & ??

15. 登錄(輸入臨時(shí)密碼 注意大小寫),登錄后提示歡迎語(yǔ),?

[root@localhost mysql]# bin/mysql --user=root -p
Enter password:?

Welcome to the MySQL monitor. ?Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.13

Copyright (c) 2000, 2016, 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.

16.在 sqlplus 命令行下修改密碼?

mysql>set password=password('123456');

授權(quán)

mysql>grant all privileges on *.* to root@'%' identified by '123456';

刷新

mysql>flush privileges;


mysql>use mysql;

mysql>select host,user from user;

................................查看完畢 此后隨意........................




總結(jié)

以上是生活随笔為你收集整理的Linux下安装-配置-mysql-5.7.13的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。