centos7rpm包安装mysql8.0.23

下载相应版本的mysql

解压后执行如下命令:

安装mysql

前提保证yum源是可用的

[root@localhost mysql8.0.23]# yum install mysql-community-{client,server,common,libs}-* -y

 

 如果仅安装客户端,则执行如下命令:

yum install mysql-community-{client,common,libs}-*

 

启动mysql并初始化

# 启动mysql

[root@localhost mysql8.0.23]# systemctl start mysqld

# 查看初始密码
[root@localhost mysql8.0.23]# grep 'temporary password' /var/log/mysqld.log

# 登陆mysql
[root@localhost mysql8.0.23]# mysql -uroot -p
Enter password:

# 修改密码

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'newPassword!';
Query OK, 0 rows affected (1.46 sec)

mysql>



Table 2.12 MySQL Installation Layout for Linux RPM Packages from the MySQL Developer Zone

Linux RPM包的MySQL安装布局来自MySQL开发者专区

Files or ResourcesLocation
Client programs and scripts /usr/bin
mysqld server /usr/sbin
Configuration file /etc/my.cnf
Data directory /var/lib/mysql
Error log file

For RHEL, Oracle Linux, CentOS or Fedora platforms: /var/log/mysqld.log

For SLES: /var/log/mysql/mysqld.log

Value of secure_file_priv /var/lib/mysql-files
System V init script

For RHEL, Oracle Linux, CentOS or Fedora platforms: /etc/init.d/mysqld

For SLES: /etc/init.d/mysql

Systemd service

For RHEL, Oracle Linux, CentOS or Fedora platforms: mysqld

For SLES: mysql

Pid file /var/run/mysql/mysqld.pid
Socket /var/lib/mysql/mysql.sock
Keyring directory /var/lib/mysql-keyring
Unix manual pages /usr/share/man
Include (header) files /usr/include/mysql
Libraries /usr/lib/mysql
Miscellaneous support files (for example, error messages, and character set files) /usr/share/mysql

 

设置远程连接

posted on 2021-01-16 10:42  wtsgtc  阅读(339)  评论(0编辑  收藏  举报

导航