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 Resources | Location |
---|---|
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: For SLES: |
Value of secure_file_priv |
/var/lib/mysql-files |
System V init script |
For RHEL, Oracle Linux, CentOS or Fedora platforms: For SLES: |
Systemd service |
For RHEL, Oracle Linux, CentOS or Fedora platforms: For SLES: |
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 |