二进制安装mysql-5.7.26
生活随笔
收集整理的這篇文章主要介紹了
二进制安装mysql-5.7.26
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
一、上傳二進(jìn)制 mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz包
#/data 是數(shù)據(jù)盤 自己根據(jù)情況定 [root@VM_0_10_centos data]# pwd/datatar xf mysql-5.7.26-linux-glibc2.12-x86_64.tar.gzmv mysql-5.7.26-linux-glibc2.12-x86_64 mysql #做軟連接 ln -s /data/mysql /usr/local/mysqlcd /data/mysqlmkdir data groupadd mysql useradd -M -g mysql -s /sbin/nologin -d /usr/local/mysql mysql chown -R mysql.mysql /usr/local/mysql/rpm -qa | grep maria* yum -y remove mari*#安裝庫 yum install -y libnuma*二、mysql 初始化、啟動、修改密碼、開機(jī)自啟動
[mysqld] port=3306 character-set-server=utf8 basedir=/usr/local/mysql datadir=/usr/local/mysql/data #innodb_buffer_pool_size=8M max_connections=1000 slow_query_log = 1 slow_query_log_file=/usr/local/mysql/log/mysql_slow_query.log long_query_time = 5 max_connections=1000 socket=/var/lib/mysql/mysql.sock [mysqld_safe]log-error=/usr/local/mysql/data/error.logpid-file=/usr/local/mysql/data/mysql.pidtmpdir=/usr/local/mysql/tmp[client] default-character-set=utf8 socket=/var/lib/mysql/mysql.sock [mysql] default-character-set=utf8# 初始化
./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
?# 配置啟動文件
cp ./support-files/mysql.server /etc/init.d/mysqldvim /etc/init.d/mysqld#basedir=/usr/local/mysql #datadir=/usr/local/mysql/data #mysqld_pid_file_path=/usr/local/mysql/data/mysql.pid#啟動數(shù)據(jù)庫service mysqld start#修改密碼./bin/mysql -u root -pSET PASSWORD FOR 'root'@localhost=PASSWORD('Your Password');#添加環(huán)境變量vim /etc/profileexport MYSQL_HOME=/usr/local/mysql export PATH=$MYSQL_HOME/bin:$PATH#環(huán)境變量生效source /etc/profile
#開機(jī)自啟動
[root@VM_0_14_centos mysql]# chmod +x /etc/rc.d/init.d/mysqld [root@VM_0_14_centos mysql]# chkconfig --add mysqld [root@VM_0_14_centos mysql]# chkconfig --list mysqldNote: This output shows SysV services only and does not include nativesystemd services. SysV configuration data might be overridden by nativesystemd configuration.If you want to list systemd services use 'systemctl list-unit-files'.To see services enabled on particular target use'systemctl list-dependencies [target]'.mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off# 如果是centos7 話可以檢查一下
systemctl start mysqld systemctl stop mysqld systemctl status mysqld?
轉(zhuǎn)載于:https://www.cnblogs.com/zhaojingyu/p/11481741.html
總結(jié)
以上是生活随笔為你收集整理的二进制安装mysql-5.7.26的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 收集一些非常实用的Linux命令
- 下一篇: 数据库设计基础:数据字典相关知识笔记