Centos 7 安裝mysql5.7.24二進(jìn)制 版本的方法及解決辦法
Mysql 二進(jìn)制安裝方法
下載mysql
https://dev.mysql.com/downloads/mysql/
1.解壓包
tar xf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz
2.實(shí)際生產(chǎn)環(huán)境
mv mysql-5.7.24-linux-glibc2.12-x86_64 /usr/local/mysql5.7
a.新增Mysql用戶(hù)組
groupadd mysql
b. 新增用戶(hù)
opt]# useradd -r -g mysql mysql
C.給mysql 目錄權(quán)限
chown -R mysql:mysql mysql5.7
3. 到初始化環(huán)境的目錄
Cd /home/usr/local/mysql5.6/ mkdir data mkdir log chown -R mysql:mysql mysql5.7
4.初始化數(shù)據(jù)和指定安裝目錄和數(shù)據(jù)目錄
./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql5.7/ --datadir=/usr/local/mysql5.7/data/
6復(fù)制啟動(dòng)文件
cp mysql.server /etc/init.d/mysqld chmod +x /etc/init.d/mysqld
7.修改啟動(dòng)路徑
vi /etc/init.d/mysqld basedir= /usr/local/mysql5.7 datadir= /usr/local/mysql5.7/data
8.增加環(huán)境變量 (最下面添加)l
vi /etc/profile export 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.7 datadir=/usr/local/mysql5.7/data #socket=/usr/local/mysql5.7/mysql.sock socket=/tmp/mysql.sock user=mysql #skip-grant-tables # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-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.log pid-file=/usr/local/mysql5.7/data/mysqld.pid # # include all files from the config directory # !includedir /etc/my.cnf.d
11.添加開(kāi)啟自啟
chkconfig --add mysqld chkconfig mysqld on
12.啟動(dòng)mysqld
service mysqld start netstat -anpt
13.修改密碼(密碼初始化的時(shí)候有個(gè)密碼)
2018-11-02T02:07:44.574468Z 1 [Note] A temporary password is generated for root@localhost: lXyB0%fi#9-S (這個(gè)就是密碼) mysql> help contents ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. mysql> help contents ERROR 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、 修改用戶(hù)密碼
mysql> alter user 'root'@'localhost' identified by 'youpassword';
或者
mysql> set password=password("youpassword");
2、刷新權(quán)限
mysql> flush privileges; mysql> help contents
總結(jié)
以上所述是小編給大家介紹的Centos 7 安裝mysql5.7.24二進(jìn)制 版本的方法 ,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
- Linux下MySQL5.7.18二進(jìn)制包安裝教程(無(wú)默認(rèn)配置文件my_default.cnf)
- CentOS6.5 上部署 MySQL5.7.17 二進(jìn)制安裝以及多實(shí)例配置
- Mysql5.7.18版本(二進(jìn)制包安裝)自定義安裝路徑教程詳解
- Centos7.5安裝mysql5.7.24二進(jìn)制包方式部署
- CentOS 7 中以命令行方式安裝 MySQL 5.7.11 for Linux Generic 二進(jìn)制版本教程詳解
- linux二進(jìn)制通用包安裝mysql5.6.20教程
- ubuntu系統(tǒng)中安裝mysql5.6(通過(guò)二進(jìn)制)
- mysql 5.7.19 二進(jìn)制最新安裝
- Linux下mysql5.6.24(二進(jìn)制)自動(dòng)安裝腳本
- Mysql二進(jìn)制安裝與備份的全過(guò)程記錄
相關(guān)文章
MySQL中使用case when 語(yǔ)句實(shí)現(xiàn)多條件查詢(xún)的方法
今天在一個(gè)應(yīng)用中使用到了一個(gè)比較特殊的數(shù)據(jù)查詢(xún)要求。需要的朋友可以參考下。2010-12-12深入mysql創(chuàng)建自定義函數(shù)與存儲(chǔ)過(guò)程的詳解
本篇文章是對(duì)mysql創(chuàng)建自定義函數(shù)與存儲(chǔ)過(guò)程進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下2013-06-06分析一條sql的性能的標(biāo)準(zhǔn)總結(jié)
在本篇文章里小編給各位分享了關(guān)于分析一條sql的性能的相關(guān)知識(shí)點(diǎn)總結(jié)內(nèi)容,有興趣的朋友們學(xué)習(xí)下。2019-07-07mysql mysqldump數(shù)據(jù)備份和增量備份
本篇文章主要講如何使用shell實(shí)現(xiàn)mysql全量,增量備份,還可以按時(shí)間備份。2013-10-10mysql存儲(chǔ)過(guò)程之游標(biāo)(DECLARE)原理與用法詳解
這篇文章主要介紹了mysql存儲(chǔ)過(guò)程之游標(biāo)(DECLARE)原理與用法,結(jié)合實(shí)例形式詳細(xì)分析了mysql存儲(chǔ)過(guò)程游標(biāo)(DECLARE)的基本功能、原理、使用方法及操作注意事項(xiàng),需要的朋友可以參考下2019-12-12