MySQL 二進(jìn)制安裝方法

創(chuàng)新互聯(lián)主營(yíng)左云網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營(yíng)網(wǎng)站建設(shè)方案,重慶APP開發(fā)公司,左云h5小程序制作搭建,左云網(wǎng)站營(yíng)銷推廣歡迎左云等地區(qū)企業(yè)咨詢
下載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用戶組
groupadd mysql
b. 新增用戶
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.添加開啟自啟
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、 修改用戶密碼
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ì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)創(chuàng)新互聯(lián)網(wǎng)站的支持!
本文標(biāo)題:Centos7安裝mysql5.7.24二進(jìn)制版本的方法及解決辦法
URL網(wǎng)址:http://chinadenli.net/article0/ppdcio.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站維護(hù)、電子商務(wù)、網(wǎng)站設(shè)計(jì)公司、建站公司、動(dòng)態(tài)網(wǎng)站、定制網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)