91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

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

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

MySQL安裝方式

發布時間:2020-07-19 03:25:49 來源:網絡 閱讀:286 作者:劉楓_Leo 欄目:MySQL數據庫

一、單實例_rpm
1、上傳安裝包
tar -xf mysql-5.7.24-1.el6.x86_64.rpm-bundle.tar
2、檢查是否安裝

rpm -qa | grep -i mysql
rpm -qa | grep -i maria
若有安裝 yum remove -y  包名
rm -fr /usr/lib/mysql
rm -fr /usr/include/mysql
rm -fr /etc/my.cnf
rm -fr /var/lib/mysql
rm -fr /usr/share/mysql
rm -fr /usr/local/mysql
find / -name mysql

3、安裝MySQL

mkdir -p /home/mysql/{3306,3307}/{data,log}
chown -R mysql:mysql /home
chmod -R 755 /home
cd /home/mysql/
rpm -ivh mysql-community-common-5.7.24-1.el6.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.24-1.el6.x86_64.rpm
rpm -ivh mysql-community-client-5.7.24-1.el6.x86_64.rpm
rpm -ivh mysql-community-server-5.7.24-1.el6.x86_64.rpm

4、my.cnf

vi /etc/my.cnf
修改目錄

5、初始化數據庫

/usr/bin/mysql_install_db --user=mysql  --datadir=/home/mysql/3306/data 
cat /root/.mysql_secret

6、啟動MySQL

cd /usr/bin/
/usr/bin/mysqld_safe  --defaults-file=/etc/my.cnf  --user=mysql  &

7、登錄MySQL

mysql -uroot -p -S /home/mysql/3306/mysql.sock
SET PASSWORD=PASSWORD('root');
flush privileges;

8、關閉MySQL
/usr/bin/mysqladmin -uroot -proot -S /home/mysql/3306/mysql.sock shutdown
二、單實例_glibc
1、上傳安裝包

tar -xvf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.7.24-linux-glibc2.12-x86_64  /usr/local/mysql
echo 'export PATH=$PATH:/usr/local/mysql/bin' >>  /etc/profile
source /etc/profile

2、創建用戶/目錄

groupadd mysql
useradd -g mysql mysql
passwd mysql
mkdir -p /home/mysql/{3306,3307}/{data,log}
chown -R mysql:mysql /home
chmod -R 755 /home

3、my.cnf

vi /etc/my.cnf
[mysql]
socket=/home/mysql/3306/data/mysql.sock
port = 3306
[mysqld]
port = 3306
#skip-grant-tables
basedir=/usr/local/mysql 
datadir=/home/mysql/3306/data/
user=mysql 
log-error=/home/mysql/3306/log/resourcepool-0559.err 
pid-file=/home/mysql/3306/data/resourcepool-0559.pid
socket=/home/mysql/3306/data/mysql.sock
symbolic-links=0
server-id=102
log-bin=mysql-bin
binlog-ignore-db = mysql,information_schema
auto-increment-offset = 1
slave-skip-errors = all
#auto-increment-increment = 2
#default-storage-engine=MyISAM
binlog_format="MIXED"
log_bin_trust_function_creators=1
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
expire_logs_days = 7
event_scheduler=1
relay-log=relay-log

4、初始化數據庫
/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/home/mysql/3306/data
5、啟動/關閉數據庫

/usr/local/mysql/bin/mysqld_safe  --defaults-file=/etc/my.cnf  --user=mysql  &
/usr/local/mysql/bin/mysqladmin -uroot -p -P3306 -S  /data/mysql/data/mysql.sock shutdown

三、多實例_glibc
1、安裝依賴

vi /etc/yum.repos.d/yum.repo
文件內容改為如下:
[base]
name=Red Hat Enterprise Linux
baseurl=file:///media/Server  
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
yum install ncurses-devel -y
yum install libail-devel -y
yum install -y gcc

2、創建用戶/目錄

groupadd mysql
useradd -g mysql mysql
passwd mysql
mkdir -p /home/mysql/{3306,3307}/{data,log}
chown -R mysql:mysql /home
chmod -R 755 /home

3、解壓安裝

tar -xvf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.7.24-linux-glibc2.12-x86_64  /usr/local/mysql
echo 'export PATH=$PATH:/usr/local/mysql/bin' >>  /etc/profile
source /etc/profile
vi /etc/my.cnf
[client]  
port=3306  
socket=/tmp/mysql.sock  

[mysqld_multi]  
mysqld = /usr/local/mysql/bin/mysqld_safe  
mysqladmin = /usr/local/mysql/bin/mysqladmin  
log = /home/mysql/mysqld_multi.log  

[mysqld]  
user=mysql  
basedir = /usr/local/mysql  
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES  

[mysqld3306]  
mysqld=mysqld  
mysqladmin=mysqladmin  
datadir=/home/mysql/3306/data  
port=3306  
server_id=3306  
socket=/tmp/mysql_3306.sock  
log-output=file  
slow_query_log = 1  
long_query_time = 1  
slow_query_log_file = /home/mysql/3306/log/slow.log  
log-error = /home/mysql/3306/log/error_3306.log  
binlog_format = mixed  
log-bin = /home/mysql/3306/data/mysql3306_bin  

[mysqld3307]  
mysqld=mysqld  
mysqladmin=mysqladmin  
datadir=/home/mysql/3307/data  
port=3307  
server_id=3307  
socket=/tmp/mysql_3307.sock  
log-output=file  
slow_query_log = 1  
long_query_time = 1  
slow_query_log_file = /home/mysql/3307/log/slow.log  
log-error = /home/mysql/3307/log/error_3307.log  
binlog_format = mixed  
log-bin = /home/mysql/3306/data/mysql3307_bin

4、初始化數據庫
/usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf --initialize-insecure --user=mysql
5、啟動數據庫
設置啟動文件
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
6、mysqld_multi進行多實例管理

啟動全部實例:/usr/local/mysql/bin/mysqld_multi start
查看全部實例狀態:/usr/local/mysql/bin/mysqld_multi report 
啟動單個實例:/usr/local/mysql/bin/mysqld_multi start 3306 
停止單個實例:/usr/local/mysql/bin/mysqladmin -u root -p -S /tmp/mysql_3306.sock shutdown
查看單個實例狀態:/usr/local/mysql/bin/mysqld_multi report 3306
mysql -S /tmp/mysql_3306.sock -p
SET PASSWORD=PASSWORD('root');
flush privileges;
向AI問一下細節
推薦閱讀:
  1. mysql安裝
  2. mysql安裝腳本

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

民权县| 扶余县| 黑龙江省| 武平县| 正镶白旗| 山阴县| 旬阳县| 遂溪县| 松原市| 什邡市| 肥乡县| 新余市| 桂林市| 牟定县| 达日县| 宣城市| 仙游县| 分宜县| 宜阳县| 六安市| 金湖县| 民县| 德惠市| 宜兴市| 北辰区| 阜城县| 温宿县| 襄樊市| 宝山区| 灵武市| 通城县| 汉阴县| 武城县| 潼关县| 旌德县| 巴青县| 抚顺市| 长沙县| 得荣县| 大港区| 任丘市|