JavaShuo
栏目
标签
centos 7 yum 安装 mysql glib 安装 mysql
时间 2019-11-18
标签
centos
yum
安装
mysql
glib
栏目
CentOS
繁體版
原文
原文链接
centos 7 YUM 在线安装版
1.wget
http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm
下载
2.rpm -Uvh mysql57-community-release-el7-10.noarch.rpm 安装rpm源
3.yum install -y mysql-community-server 取决于网速
4.systemctl start mysqld.service / service mysqld start 启动mysql
5.service mysqld status 查看启动状态
6.
7.grep 'temporary password' /var/log/mysqld.log 查看mysql临时密码
8.mysql -uroot -p 登陆mysql
9.ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
修改密码-> 提示: ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
10. set global validate_password_policy=0;
11. set global validate_password_length=1; 重复9步骤--->修改密码
12.GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION; 开放远程登陆
FLUSH PRIVILEGES; 刷新配置
13.关闭防火墙
查看防火墙 systemctl status firewalld.service / service iptables status status/start/restart/stop --option
14.修改配置文件
vi /etc/my.cnf 编辑my.cnf / 没有手动建立文件
正确配置
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
[mysqld]
character_set_server=utf8
#[client]
#default-character-set=utf8
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
15.systemctl status mysqld.service 查看mysql 状态 status/start/stop/restart -- option
Centos glib版安装
1.tar -zvxf mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz 解压
2.mv mysql-5.7.26-linux-glibc2.12-x86_64/* /usr/local/mysql 移动文件
3.groupadd user 添加用户
4.useradd -r -g mysql mysql 添加用户组
5.rpm -qa | grep libaio 检查libaio
6.
yum -y install libaio
安装libaio
7.vi /etc/my.cnf 编辑my.cnf / 没有手动建立文件
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
socket=/var/lib/mysql/mysql.sock
[mysqld]
#skip-name-resolve
#设置3306端口
port = 3306
socket=/var/lib/mysql/mysql.sock
# 设置mysql的安装目录
basedir=/usr/local/mysql
# 设置mysql数据库的数据的存放目录
datadir=/usr/local/mysql/data
# 容许最大链接数
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 建立新表时将使用的默认存储引擎
#default-storage-engine=MyIsam
default-storage-engine=INNODB
#lower_case_table_name=1
max_allowed_packet=16M
8.mkdir data 建立目录
9.[root@localhost mysql]# chown -R mysql:mysql ./ 受权目录拥有者
10.[root@localhost mysql]# ./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ 初始化
11.成功图示
12.[root@localhost mysql]# cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
13.增长 mysqld 服务控制脚本执行权限:[root@localhost mysql]# chmod +x /etc/rc.d/init.d/mysqld
14.将 mysqld 服务加入到系统服务:[root@localhost mysql]# chkconfig --add mysqld
15.检查mysqld服务是否已经生效:[root@localhost mysql]# chkconfig --list mysqld
16.[root@localhost mysql]# service mysqld start 启动mysql 提示 err目录 pid不存在
Starting MySQL.Logging to '/usr/local/mysql/data/localhost.localdomain.err'.
2019-07-04T02:40:27.646818Z mysqld_safe Directory '/var/lib/mysql' for UNIX socket file don't exists.
ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid).
17.[root@localhost mysql]# mkdir /var/lib/mysql
[root@localhost mysql]# chown -R mysql /var/lib/mysql
18.再次启动
19.登陆 提示command
20.进行软连接
ln -s /usr/local/mysql/bin/mysql /usr/bin
21.
22.先进行密码设置 ,
SET PASSWORD = PASSWORD('123456'); 设置初始密码。 否则操做不了数据库
23.提示 You must reset your password using ALTER USER statement before executing this statement.
24
25.use mysql 切到系统库
26.mysql> grant all privileges on *.* to root@"%" identified by "123456" with grant option; 受权远程登陆
Query OK, 0 rows affected, 1 warning (0.00 sec)
27.mysql> flush privileges; 刷新
Query OK, 0 rows affected (0.00 sec)
28. systemctl status mysqld.service mysql 状态
29.systemctl status firewalld.service 关闭防火墙
30.
完毕。整理OK。亲测可用。注意以上安装都没有配置环境变量。虚拟学习而已
补充:
html
相关文章
1.
CentOS 7 yum 安装 MySQL
2.
CentOS 7 用yum安装 MySQL
3.
centos yum MySQL安装
4.
centos yum 安装mysql
5.
CentOS 7 安装 MySQL
6.
CentOS 7安装MySQL
7.
CentOS 7 安装 Mysql
8.
CentOS 7安装Mysql
9.
centos 7安装 mysql
10.
centos 7 安装 MySql
更多相关文章...
•
CentOS Docker 安装
-
Docker教程
•
Docker 安装 MySQL
-
Docker教程
•
Composer 安装与使用
•
IntelliJ IDEA安装代码格式化插件
相关标签/搜索
yum安装
安装
mysql 安装教程
MySQL基础 安装
yum安装方式
yum在线安装
PyCharm的安装
工具安装
ROS安装
环境安装
Unix
MySQL
CentOS
MySQL教程
PHP 7 新特性
Hibernate教程
mysql
0
分享到微博
分享到微信
分享到QQ
每日一句
每一个你不满意的现在,都有一个你没有努力的曾经。
最新文章
1.
Mud Puddles ( bfs )
2.
ReSIProcate环境搭建
3.
SNAT(IP段)和配置网络服务、网络会话
4.
第8章 Linux文件类型及查找命令实践
5.
AIO介绍(八)
6.
中年转行互联网,原动力、计划、行动(中)
7.
详解如何让自己的网站/APP/应用支持IPV6访问,从域名解析配置到服务器配置详细步骤完整。
8.
PHP 5 构建系统
9.
不看后悔系列!Rocket MQ 使用排查指南(附网盘链接)
10.
如何简单创建虚拟机(CentoOS 6.10)
本站公众号
欢迎关注本站公众号,获取更多信息
相关文章
1.
CentOS 7 yum 安装 MySQL
2.
CentOS 7 用yum安装 MySQL
3.
centos yum MySQL安装
4.
centos yum 安装mysql
5.
CentOS 7 安装 MySQL
6.
CentOS 7安装MySQL
7.
CentOS 7 安装 Mysql
8.
CentOS 7安装Mysql
9.
centos 7安装 mysql
10.
centos 7 安装 MySql
>>更多相关文章<<