标签:问题: bin var chgrp axel comm bnu 最新版 ble
删除已经安装版本
yum list installed mysql
[root@localhost ~]# yum list installed mysql
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.cn99.com
* extras: mirrors.cn99.com
* updates: mirrors.cn99.com
Installed Packages
mysql.x86_64
yum remove mysql.x86_64
1.下载安装
tar -xvzf mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.7.20-linux-glibc2.12-x86_64 /usr/local/mysql
添加用户及用户分组、目录权限
groupadd mysql
useradd mysql -g mysql
cd mysql
chown -R mysql .
chgrp -R mysql .
安装依赖库
yum install libaio
yum install -y libnuma.so.1
安装数据库(数据库初始化)
cd /usr/local/mysql
mkdir data
cd /usr/local/mysql/bin
./mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data
-------注意,数据存储目录,因为/目录空间很小不够使用,所以我把数据存储到 /data/mysql57下了,即
mkdir /data/mysql57
chown -R mysql /data/mysql57
chgrp -R mysql /data/mysql57
cd /usr/local/mysql/bin
./mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/data/mysql57
这里可能会遇到的问题:
Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory
原因:是用yum 安装的libnuma.so.1,安装时默认安装的是32的,但db需要的是64位的
解决办法:1.如果已经安装了libnuma.so.1,先yum remove libnuma.so.1;安装 yum -y install numactl.x86_64
2.启动登陆
cd /usr/local/mysql/support-files
./mysql.server start
登录mysql,此版本最新版不许空密码登录,实际上有个初始化密码保存在/root/.mysql_secret这个文件里面,用这个密码第一次登录后,再修改密码。因此先cat查看下初始化密码(随机的,每次安装看到的密码都不一样):
[root@localhost ~]# cat /root/.mysql_secret
cd /usr/local/mysql/bin
./mysql -uroot -pI+0tKc3(kDS/
改mysql的root密码,新密码在此为‘leizm‘
mysql> set password=password(‘12root‘);
Query OK, 0 rows affected, 1 warning (0.00 sec)
GRANT ALL PRIVILEGES ON *.* TO root@‘%‘ identified by ‘123456a‘;
flush privileges;
3. 添加系统服务
shell> cp support-files/mysql.server /etc/init.d/mysqldshell> service mysqld start
如果启动过程或mysql客户端连接有问题配置 my.cnf
vi /etc/my.cnf
[mysqld]
bind-address=0.0.0.0
#mysql安装根目录
basedir = /usr/local/mysql
#datadir=/var/lib/mysql
datadir=/data/mysql57
#socket=/var/lib/mysql/mysql.sock
socket=/data/mysql57/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
#Port number to use for connections.
port=15024
#innodb_buffer_pool_size=256M
max_allowed_packet = 32M
#query_cache_size = 128M
max_connections=300
log-bin=mysql-bin
server-id=10632
[client]
socket =/data/mysql57/mysql.sock
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
MySql5.7 配置文件 my.cnf 设置
mysql安装-CentOS6下解压安装mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz
标签:问题: bin var chgrp axel comm bnu 最新版 ble
原文地址:https://www.cnblogs.com/exmyth/p/9141522.html