centos7.2 環境下 mysql-5.1.73 安裝配置


安裝mysql,安裝前准備
如果mysql用戶不存在,那么添加mysql用戶

groupadd mysql
useradd -g mysql mysql

mysql編譯安裝
tar -zxvf mysql-5.1.73.tar.gz
cd mysql-5.1.73

yum install ncurses ncurses-devel
./configure  '--prefix=/usr/local/mysql' '--without-debug' '--with-charset=utf8' '--with-extra-charsets=all' '--enable-assembler' '--with-pthread' '--enable-thread-safe-client' '--with-mysqld-ldflags=-all-static' '--with-client-ldflags=-all-static' '--with-big-tables' '--with-readline' '--with-ssl' '--with-embedded-server' '--enable-local-infile' '--with-plugins=innobase'

make
make install

到此mysql就安裝到了/usr/local/mysql路徑下,下面開始mysql的配置工作
安裝mysql選項文件

cp support-files/my-medium.cnf /etc/my.cnf
cp -r support-files/mysql.server /etc/init.d/mysqld 
/sbin/chkconfig --del mysqld
/sbin/chkconfig --add mysqld

配置權限表
chown -R mysql:mysql /usr/local/mysql
/usr/local/mysql/bin/mysql_install_db --user=mysql


啟動mysql
給/etc/init.d/mysql 執行權限,然后運行
chmod a+wrx /etc/init.d/mysql
/etc/init.d/mysqld start

mysql初始化配置:
包括密碼設置等
export PATH=/usr/local/mysql/bin:$PATH
/usr/local/mysql/bin/mysql_secure_installation
 
在彈出的對話框中要求輸入密碼:
Enter current password for root (enter for none):
默認打回車,然后重新設置root密碼:

Set root password? [Y/n] y

Disallow root login remotely? [Y/n] n

Remove test database and access to it? [Y/n] n

Reload privilege tables now? [Y/n] y


至此,Mysql運行成功

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM