11.1 LAMP架構介紹 11.2 MySQL、MariaDB介紹 11.3/11.4/11.5 MySQL安裝

11.1 LAMP架構介紹html

11.2 MySQL、MariaDB介紹mysql

 

11.3/11.4/11.5 MySQL安裝linux

MySQL的幾個經常使用安裝包:rpm、源碼、二進制免編譯sql

cd /usr/local/src

wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz

tar zxvf mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz

mv mysql-5.6.36-linux-glibc2.5-x86_64 /usr/local/mysql

cd /usr/local/mysql

ls

useradd mysql

mkdir /data/

./scripts/mysql_install_db --user=mysql --datadir=/data/mysql

cp support-files/my-default.cnf  /etc/my.cnf

datadir=/data/mysql

socket=/tmp/mysql.sock

cp support-files/mysql.server /etc/init.d/mysqld

vi /etc/init.d/mysqld

定義basedir和datadir

basedir=/usr/local/mysql

datadir=/data/mysql


/etc/init.d/mysqld start

ps aux |grep mysql

[root@c-72 mysql]# chkconfig --add mysqld

[root@c-72 mysql]# chkconfig mysqld on

[root@c-72 mysql]# service mysqld stop

Shutting down MySQL.. SUCCESS!

[root@c-72 mysql]# service mysqld start

Starting MySQL. SUCCESS!

[root@c-72 mysql]#

 

儘可能把全部源碼包都安裝在一個路徑。安裝大概須要耐心等待一下。架構

[root@c-72 mysql]# ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql

Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

[root@c-72 mysql]# yum install libaio* -y    //緣由:缺乏libaio庫文件

 

兩種方式驗證下載是否正確socket

     1.看是否有兩個OKspa

  1. echo $?  看輸出結果是否爲0  檢驗的是 上條命令

cp support-files/mysql.server /etc/init.d/mysqldcode

basedir=/usr/local/mysqlserver

datadir=/data/mysqlhtm

ls -l /etc/init.d/mysqld

chkconfig --add mysqld

service mysqld start

ps aux |grep mysql

netstat -lntp

假如沒有辦法把啓動的腳本放在/ect/init  或者說沒有這樣的啓動腳本模板去拷貝,

killall 先中止讀寫操做 儘可能用killall  慢慢等待

   默認引擎

 

擴展

mysql5.5源碼編譯安裝 http://www.aminglinux.com/bbs/thread-1059-1-1.html

mysql5.7二進制包安裝(變化較大) http://www.apelearn.com/bbs/thread-10105-1-1.html

相關文章
相關標籤/搜索