(1)获取mysql:
https://dev.mysql.com/downloads/mysql/
(2)解压缩下载好的MySQL安装文件,选择合适的安装目录进行安装
新建data文件夹与添加my.ini文件
(3)my.ini文件写入基本配置并更改相关路径。
(4)运行CMD在MySQL目录下的bin目录下执行命令:mysqld --initialize --console
记住初始密码:
(5)安装mysql服务:执行mysqld --install
服务安装成功之后通过命令net start mysql启动MySQL的服务
(6)启动CMD,执行以下命令:mysql -uroot -p
并执行以下命令修改密码:
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
(1)访问MySQL安装源地址:https://dev.mysql.com/downloads/repo/yum/ 下载源文件
(2)通过CRT上传mysql-5.7.18到/opt/softwares下
(3)安装MySQL并检查安装情况
(4)修改my.cnf: vi /etc/
并在末尾添加以下代码
default-storage-engine=innodb
innodb_file_per_table
collation-server=utf8_general_ci
init-connect='SET NAMES utf8'
character-set-server=utf8
(5) 启动mysql服务和查看其状态
启动: systemctl start mysqld
查看:systemctl status mysqld
(6)获取初始密码:cat /var/log/mysqld.log | grep password
(7)进入MySQL修改密码ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password_123';