mysql

mysq8.0 rpm包安装步骤

解压mysql-8.0.33-1.el8.aarch64.rpm-bundle.tar

删掉test包

安装: rpm -ivh *.rpm

命令:vim  /etc/my.cnf

在[client]字段里加入 default-character-set=utf8

在[mysqld]字段里加入 datadir= 数据目录 character-set-server=utf8 lower_case_table_names = 1

初始化mysql

命令:mysqld –initialize –user=mysql –lower-case-table-names=1

报错,找不到libssl.so.10: 下载包: https://vault.centos.org/centos/8/AppStream/x86_64/os/Packages/compat-openssl10-1.0.2o-3.el8.x86_64.rpm (rpm -ivh 安装) aarch64: https://vault.centos.org/centos/8/AppStream/aarch64/os/Packages/compat-openssl10-1.0.2o-3.el8.aarch64.rpm

查看默认密码: cat /var/log/mysqld.log

启动mysql:

systemctl start mysqld

查看mysql的状态判断是否启动成功

命令:systemctl status mysqld

登录mysql:

Mysql -u root -p (然后输入默认的密码)

 

第一次进入 修改密码:

 alter user ‘root’@‘localhost’ identified by ‘abc234&34’;

重启mysql服务

命令:systemctl restart mysqld

开启远程访问: use mysql;

update user set host=“%” where user=‘root’; GRANT ALL PRIVILEGES ON . TO ‘root’@’%’WITH GRANT OPTION;

FLUSH PRIVILEGES;

关于作者

程序员,软件工程师,java, golang, rust, c, python,vue, Springboot, mybatis, mysql,elasticsearch, docker, maven, gcc, linux, ubuntu, centos, axum,llm, paddlepaddle, onlyoffice,minio,银河麒麟,中科方德,rpm