linux上安裝mysql
os: CentOS Linux release 7.7.1908 (Core)
mysql: Mysql5.7.21
1. 下載安裝包:
[root@localhost rpm]# ls -l
total 461684
-rw-r--r-- 1 root root 23850100 Oct 13 15:13 mysql-community-client-5.7.21-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 337036 Oct 13 15:13 mysql-community-common-5.7.21-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 3721376 Oct 13 15:13 mysql-community-devel-5.7.21-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 39214116 Oct 13 15:13 mysql-community-embedded-5.7.21-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 136516836 Oct 13 15:13 mysql-community-embedded-devel-5.7.21-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 2177444 Oct 13 15:13 mysql-community-libs-5.7.21-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 1723492 Oct 13 15:13 mysql-community-libs-compat-5.7.21-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 159856456 Oct 13 15:13 mysql-community-server-5.7.21-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 105350080 Oct 13 15:13 mysql-community-test-5.7.21-1.el6.x86_64.rpm
2. 批次安裝Mysql安裝包:
[root@localhost rpm]# rpm -Uvh *.rpm --nodeps --force
warning: mysql-community-client-5.7.21-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:mysql-community-common-5.7.21-1.e################################# [ 10%]
2:mysql-community-libs-5.7.21-1.el6################################# [ 20%]
3:mysql-community-client-5.7.21-1.e################################# [ 30%]
4:mysql-community-server-5.7.21-1.e################################# [ 40%]
5:mysql-community-devel-5.7.21-1.el################################# [ 50%]
6:mysql-community-embedded-5.7.21-1################################# [ 60%]
7:mysql-community-embedded-devel-5.################################# [ 70%]
8:mysql-community-test-5.7.21-1.el6################################# [ 80%]
9:mysql-community-libs-compat-5.7.2################################# [ 90%]
Cleaning up / removing...
10:mariadb-libs-1:5.5.64-1.el7 ################################# [100%]
3. 檢查安裝包:
[root@localhost rpm]# rpm -qa | grep mysql
mysql-community-client-5.7.21-1.el6.x86_64
mysql-community-embedded-devel-5.7.21-1.el6.x86_64
mysql-community-libs-5.7.21-1.el6.x86_64
mysql-community-server-5.7.21-1.el6.x86_64
mysql-community-embedded-5.7.21-1.el6.x86_64
mysql-community-test-5.7.21-1.el6.x86_64
mysql-community-common-5.7.21-1.el6.x86_64
mysql-community-devel-5.7.21-1.el6.x86_64
mysql-community-libs-compat-5.7.21-1.el6.x86_64
4. 修改my.cnf
按照需求修改mysql資料目錄及新增其他引數。
5.初始化Mysql例項
[root@localhost mysql]# service mysqld start
Starting mysqld (via systemctl): [ OK ]
6.修改root密碼
[root@localhost log]# cat mysqld.log | grep password
2020-10-13T07:45:47.532299Z 1 [Note] A temporary password is generated for root@localhost: u&r-xf+Zh9Wn
2020-10-13T07:45:51.454915Z 2 [Note] Access denied for user 'UNKNOWN_MYSQL_USER'@'localhost' (using password: NO)
mysql> set password = password("M_123456");
Query OK, 0 rows affected, 1 warning (0.00 sec)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21374452/viewspace-2726618/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux上yum安裝mysql5.6LinuxMySql
- Linux Centos上安裝 MySQL 8.0.16LinuxCentOSMySql
- mysql在linux上cmake安裝方法(自己安裝版)MySqlLinux
- 怎樣在 Ubuntu Linux 上安裝 MySQLUbuntuLinuxMySql
- MySQL Linux壓縮版安裝方法(上)MySqlLinux
- RHEL 9 / Rocky Linux 9 上安裝 MySQLLinuxMySql
- 如何在 Linux 上安裝 MariaDB 或 MySQLLinuxMySql
- Linux上安裝jdk Tomcat mysql redis等LinuxJDKTomcatMySqlRedis
- Linux安裝解除安裝MySQLLinuxMySql
- mysql安裝 for LinuxMySqlLinux
- linux 安裝mysqlLinuxMySql
- mysql 安裝 linuxMySqlLinux
- mysql for linux 安裝MySqlLinux
- Linux安裝MySQLLinuxMySql
- arch linux上安裝 httpd+php+mysql+ openssl(轉)LinuxhttpdPHPMySql
- Linux下安裝、解除安裝mysqlLinuxMySql
- mysql 在windows上安裝MySqlWindows
- 【MySQL安裝】Linux下安裝MySQL(預編譯)MySqlLinux編譯
- linux上安裝ELKLinux
- linux上安裝mongodbLinuxMongoDB
- linux 上安裝kapacitorLinux
- linux上安裝VNCLinuxVNC
- linux上安裝oracleLinuxOracle
- Linux上安裝gitLinuxGit
- Mysql篇--Linux中安裝MysqlMySqlLinux
- Linux-Ubuntu-mysql-安裝&解除安裝LinuxUbuntuMySql
- mysql linux下安裝MySqlLinux
- Linux安裝mysql 8.0LinuxMySql
- 最新!linux mysql安裝LinuxMySql
- Linux解除安裝MySQLLinuxMySql
- Linux下Mysql安裝LinuxMySql
- Mysql+linux安裝MySqlLinux
- linux安裝mysql dbiLinuxMySql
- linux 下安裝mysqlLinuxMySql
- linux下安裝MysqlLinuxMySql
- mysql在linux安裝MySqlLinux
- [linux]linux下安裝mysqlLinuxMySql
- Mysql for Linux安裝配置之—— 原始碼安裝MySqlLinux原始碼