国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

Centos 7 安裝mysql5.7.24二進制 版本的方法及解決辦法

2024-07-25 19:09:13
字體:
來源:轉載
供稿:網友

Mysql 二進制安裝方法

下載mysql

https://dev.mysql.com/downloads/mysql/

1.解壓包

tar xf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz

2.實際生產環境

mv mysql-5.7.24-linux-glibc2.12-x86_64 /usr/local/mysql5.7 

a.新增Mysql用戶組

 groupadd mysql

b. 新增用戶

opt]# useradd -r -g mysql mysql

C.給mysql 目錄權限

chown -R mysql:mysql mysql5.7

3. 到初始化環境的目錄

 Cd /home/usr/local/mysql5.6/mkdir datamkdir logchown -R mysql:mysql mysql5.7

4.初始化數據和指定安裝目錄和數據目錄

./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql5.7/ --datadir=/usr/local/mysql5.7/data/

6復制啟動文件

 cp mysql.server /etc/init.d/mysqldchmod +x /etc/init.d/mysqld

7.修改啟動路徑

 vi /etc/init.d/mysqldbasedir= /usr/local/mysql5.7datadir= /usr/local/mysql5.7/data

 

8.增加環境變量 (最下面添加)l

 vi /etc/profileexport MYSQL_HOME=" /usr/local/mysql5.7"export PATH="$PATH:$MYSQL_HOME/bin"

9.刷新配置文件

source /etc/profile

修改配置文件

vi /etc/my.cnf[client]port=3306[mysqld]basedir=/usr/local/mysql5.7datadir=/usr/local/mysql5.7/data#socket=/usr/local/mysql5.7/mysql.socksocket=/tmp/mysql.sockuser=mysql#skip-grant-tables# Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links=0# Settings user and group are ignored when systemd is used.# If you need to run mysqld under a different user or group,# customize your systemd unit file for mariadb according to the# instructions in http://fedoraproject.org/wiki/Systemd[mysqld_safe]log-error=/usr/local/mysql5.7/log/mysqld.logpid-file=/usr/local/mysql5.7/data/mysqld.pid## include all files from the config directory#!includedir /etc/my.cnf.d

11.添加開啟自啟

 chkconfig --add mysqld chkconfig mysqld on

12.啟動mysqld

 service mysqld start netstat -anpt

13.修改密碼(密碼初始化的時候有個密碼)

2018-11-02T02:07:44.574468Z 1 [Note] A temporary password is generated for root@localhost: lXyB0%fi#9-S (這個就是密碼)mysql> help contentsERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.mysql> help contentsERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.mysql> show databases;ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

 

解決辦法

1、 修改用戶密碼

mysql> alter user 'root'@'localhost' identified by 'youpassword';

或者

mysql> set password=password("youpassword");

2、刷新權限

mysql> flush privileges;mysql> help contents

總結

以上所述是小編給大家介紹的Centos 7 安裝mysql5.7.24二進制 版本的方法 ,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對VeVb武林網網站的支持!


注:相關教程知識閱讀請移步到MYSQL教程頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 清涧县| 平安县| 南安市| 馆陶县| 三明市| 内江市| 札达县| 青龙| 从江县| 始兴县| 集贤县| 巴中市| 北京市| 大悟县| 靖州| 尚义县| 安西县| 田林县| 崇州市| 南昌县| 遂宁市| 阳东县| 莱阳市| 嘉黎县| 鸡东县| 太白县| 通辽市| 峨眉山市| 茂名市| 水富县| 福泉市| 泾阳县| 湖北省| 丘北县| 福贡县| 铜陵市| 隆尧县| 萝北县| 遵化市| 宣城市| 广州市|