Centos上安装MySQL
程序员文章站
2022-07-04 23:44:08
1、去官网查找最新(你需要的)安装包版本 # https://dev.mysql.com/downloads/repo/yum/ 2、下载MySQL安装包 # wget http://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.r ......
1、去官网查找最新(你需要的)安装包版本
# https://dev.mysql.com/downloads/repo/yum/
2、下载mysql安装包
# wget http://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
3、安装mysq源
# yum -y install mysql80-community-release-el7-3.noarch.rpm
4、查看安装结果
# yum repolist enabled | grep mysql.*
mysql-connectors-community/x86_64 mysql connectors community 128
mysql-tools-community/x86_64 mysql tools community 100
mysql80-community/x86_64 mysql 8.0 community server 145
5、安装mysql服务
# yum install mysql-community-server -y
6、启动mysql
# service mysqld start # netstat -lntp | grep 3306 //查看3306端口是否起了
# systemctl status mysqld.service //查看mysql的运行状态
7、查看mysql日志,筛选出临时密码
# grep "password" /var/log/mysqld.log
8、用临时密码登录到mysql
# mysql -uroot -p
9、更改root密码,密码要大小写加字符(密码有复杂性要求)
mysql> alter user 'root'@'localhost' identified by 'newpasswd';
10、修改 /etc/my.cnf 或 /etc/mysql/my.cnf,文件加入 utf-8编码
# vim /etc/my.cnf //把下面代码粘进去就好 [client] default-character-set = utf8 [mysqld] default-storage-engine = innodb character-set-server = utf8 collation-server = utf8_general_ci # service mysqld restart //重启数据库即可
下一篇: redis系列之------字典
推荐阅读
-
mysql-5.7.21 二进制安装 | Jemalloc内存优化 | 备份恢复|修改密码
-
VS2005上不安装ASPAJAXExtSetup.msi开发和发布ajax网站 博客分类: Ajax AjaxASP.netASPWeb.net
-
VS2005上不安装ASPAJAXExtSetup.msi开发和发布ajax网站 博客分类: Ajax AjaxASP.netASPWeb.net
-
【mysql】Linux centos 7.5 + mysql5.7二进制自动安装脚本(包括自动修改root密码)
-
CentOS6CentOS7二进制安装MYSQL5.7,修改默认密码
-
CentOS6.4下安装xampp 博客分类: PHP php
-
centos(6,7)系统下安装telnet
-
Ubuntu下安装MySQL(阿里云服务器)
-
阿里云ECS服务器CentOS7上安装MYSQL
-
阿里云ECS服务器linux系统安装mysql