溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

mysql二進(jìn)制包使用實(shí)例分析

發(fā)布時(shí)間:2022-02-16 09:49:13 來源:億速云 閱讀:90 作者:iii 欄目:開發(fā)技術(shù)

這篇“mysql二進(jìn)制包使用實(shí)例分析”文章的知識點(diǎn)大部分人都不太理解,所以小編給大家總結(jié)了以下內(nèi)容,內(nèi)容詳細(xì),步驟清晰,具有一定的借鑒價(jià)值,希望大家閱讀完這篇文章能有所收獲,下面我們一起來看看這篇“mysql二進(jìn)制包使用實(shí)例分析”文章吧。

mysql二進(jìn)制包使用實(shí)例分析
1.安裝之前,先創(chuàng)建mysql用戶
[root@linuxprobe_nfs ~]# useradd mysql -s /sbin/nologin -M[root@linuxprobe_nfs ~]# id mysqluid=500(mysql) gid=500(mysql) groups=500(mysql)
2.軟件包的下載及解壓
[root@linuxprobe_nfs ~]# mkdir /home/chenfan/tools  -p[root@linuxprobe_nfs ~]# cd /home/chenfan/tools在http://dev.mysql.com/downloads/mysql/官網(wǎng)上下載mysql-5.5.32-linux2.6-x86_64.tar.gz
[root@linuxprobe_nfs tools]# lsmysql-5.5.32-linux2.6-x86_64.tar.gz
[root@linuxprobe_nfs tools]# tar zxvf mysql-5.5.32-linux2.6-x86_64.tar.gz[root@linuxprobe_nfs tools]# lsmysql-5.5.32-linux2.6-x86_64  mysql-5.5.32-linux2.6-x86_64.tar.gz
[root@linuxprobe_nfs local]# mv mysql-5.5.32-linux2.6-x86_64 /usr/local/mysql-5.5.32  ###免編譯安裝[root@linuxprobe_nfs local]# cd /usr/local[root@linuxprobe_nfs local]# ln -s mysql-5.5.32  mysql  ###此處的軟鏈接為了版本升級提供了便利
3.初始化數(shù)據(jù)庫
[root@linuxprobe_nfs local]# mysql/scripts/mysql_install_db  --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/  --user=mysql###此處如果初始化發(fā)生錯(cuò)誤,刪除data目錄下的內(nèi)容,rm -fr  mysql/data/*,重新初始化。
4.生成MySQL配置文件
[root@linuxprobe_nfs local]# cd mysql[root@linuxprobe_nfs mysql]# cp support-files/my-small.cnf  /etc/my.cnf
5.授權(quán)管理文件
[root@linuxprobe_nfs ~]# chown -R mysql:mysql /usr/local/mysql/[root@linuxprobe_nfs ~]# ls -ld /usr/local/mysql/drwxr-xr-x. 13 mysql mysql 4096 Jun 24 17:21 /usr/local/mysql/
6.設(shè)置科學(xué)的啟動(dòng)方式
[root@linuxprobe_nfs mysql]# cp support-files/mysql.server  /etc/init.d/mysqld[root@linuxprobe_nfs mysql]# chmod +x /etc/init.d/mysqld[root@linuxprobe_nfs mysql]# /etc/init.d/mysqld startStarting MySQL... SUCCESS!
[root@linuxprobe_nfs mysql]# chkconfig --add mysqld[root@linuxprobe_nfs mysql]# chkconfig mysqld on[root@linuxprobe_nfs mysql]# chkconfig --list mysqldmysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off### 設(shè)置開機(jī)自啟動(dòng)mysql
7.配置MySQL環(huán)境變量
[root@linuxprobe_nfs mysql]# echo 'PATH=/usr/local/mysql/bin:$PATH' >> /etc/profile[root@linuxprobe_nfs mysql]# source /etc/profile[root@linuxprobe_nfs mysql]# echo $PATH/usr/local/mysql/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin###此處PATH路徑的設(shè)置為了后續(xù)mysql命令的使用
8.mysql登陸與密碼設(shè)置
[root@linuxprobe_nfs mysql]# mysqlWelcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.32 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, 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>

[root@linuxprobe_nfs mysql]# mysqladmin  -uroot password 'chenfan'###密碼的設(shè)置[root@linuxprobe_nfs mysql]# mysql -uroot -pEnter password: chenfan###交互式登陸###至此完成MySQL的全部初始安裝與配置

以上就是關(guān)于“mysql二進(jìn)制包使用實(shí)例分析”這篇文章的內(nèi)容,相信大家都有了一定的了解,希望小編分享的內(nèi)容對大家有幫助,若想了解更多相關(guān)的知識內(nèi)容,請關(guān)注億速云行業(yè)資訊頻道。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI