日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

linux安装mysql5.7.18_Linux 安装MySQL5.7.18

發(fā)布時間:2025/4/5 数据库 19 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux安装mysql5.7.18_Linux 安装MySQL5.7.18 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

https://dev.mysql.com/downloads/mysql/

Linux-Generic

md5sum mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz

Linux環(huán)境檢查

1 關(guān)閉numa

[root@node130 ~]#? vim /boot/grub/grub.conf

title Red Hat Enterprise Linux (2.6.32-358.el6.x86_64)

root (hd0,0)

kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=UUID=cb7d8bdc-28a5-4dbd-b04a-3ad9ee3e6bba rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto? KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet numa=off

[root@node130 ~]# numactl --hardware

[root@node130 ~]#numactl --show

2限制設(shè)置 /etc/security/limits.conf

[root@node130 ~]# vim /etc/security/limits.conf

* soft??? nofile? 1024000

* hard??? nofile? 1024000

* soft??? nproc?? unlimited

* hard??? nproc?? unlimited

* soft??? core??? unlimited

* hard??? core??? unlimited

* soft??? memlock unlimited

* hard??? memlock unlimited

3 Swap

[root@node130 ~]# vim /etc/sysctl.conf

vm.swappiness=0

sysctl -p 生效

[root@node130 ~]# sysctl -a|grep swap

vm.swappiness = 0

6 selinux & iptables

selinux:

[root@node130 ~]# vim /etc/sysconfig/selinux

SELINUX=disabled

SELINUXTYPE=targeted

[root@node130 ~]# getenforce

Disabled

setenforce 0

getenforce

chkconfig --list|grep iptables

chkconfig --del iptables

[root@node130 ~]# chkconfig --list|grep iptables

iptables?????? ?0:off?1:off?2:off?3:off?4:off?5:off?6:off

[root@node130 ~]# chkconfig --del iptables

[root@node130 ~]# chkconfig --list|grep iptables

[root@node130 ~]# reboot

1創(chuàng)建賬戶

[root@node130 home]# groupadd mysql

[root@node130 home]# useradd -g mysql -d /user/local/mysql -s /sbin/nologin -M mysql

[root@node130 home]# id mysql

uid=505(mysql) gid=506(mysql) groups=506(mysql)

[root@node130 home]# mkdir /opt/mysql

[root@node130 mysql]# tar xvf mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz

[root@node130 ~]# cd /usr/local/

cd /user/local/

[root@node130 local]# ln -s /opt/mysql/mysql-5.7.18-linux-glibc2.5-x86_64 mysql

[root@node130 local]# chown -R mysql:mysql mysql/

[root@node130 mysql]# echo "export PATH=$PATH:/usr/local/mysql/bin">>/etc/profile

[root@node130 mysql]# source /etc/profile

/data 是一個單獨(dú)掛載的分區(qū)

[root@node130 mysql]# mkdir -p /data/mysql/mysql_3306/{data,logs,tmp}

[root@node130 mysql_3306]# chown -R mysql:mysql /data/mysql/mysql_3306/

[root@node130 ~]# cp /opt/my.cnf /etc/

初始化

[root@node130 mysql]# ./bin/mysqld? --defaults-file=/etc/mysql3306.cnf --initialize

[root@node130 mysql]# cat /data/mysql/mysql_3306/data/error.log |grep password

2017-04-28T06:36:55.453219Z 1 [Note] A temporary password is generated for root@localhost: rFcPw

啟動

[root@node130 mysql]# cp support-files/mysql.server /etc/init.d/mysql

[root@node130 mysql]# /etc/init.d/mysql start

Starting MySQL...................... SUCCESS!

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

or

[root@node130 ~]# /usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf &

[1] 2787

[root@node130 tmp]# mysql -S /tmp/mysql.sock -p

Enter password:

Welcome to the MySQL monitor.? Commands end with ; or g.

Your MySQL connection id is 3

Server version: 5.7.18-log

Copyright (c) 2000, 2017, 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.

"(unknown)@localhost:mysql.sock? [(none)]>alter user user() identified by '123456';

Query OK, 0 rows affected (0.01 sec)

"root@localhost:mysql.sock? [(none)]>show databases;

+--------------------+

| Database?????????? |

+--------------------+

| information_schema |

| mysql????????????? |

| performance_schema |

| sys??????????????? |

+--------------------+

4 rows in set (0.09 sec)

"root@localhost:mysql.sock? [(none)]>exit

Bye

[root@node130 etc]# mysqladmin -S /tmp/mysql.sock -p shutdown

Enter password:

總結(jié)

以上是生活随笔為你收集整理的linux安装mysql5.7.18_Linux 安装MySQL5.7.18的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。