centeros6.8 mysql_centeros7安装mysql8,以及设置root密码
2.點擊下載后,在下載頁面選擇操作系統
3.點擊下載rpm文件,拿到這個下載鏈接
4.移除mariadb數據庫
yum remove mariadb-libs.x86_64
5.進入到/tmp目錄使用wget下載
wget https://repo.mysql.com//mysql80-community-release-el7-2.noarch.rpm
6.安裝mysql的源
yum localinstall mysql80-community-release-el7-2.noarch.rpm
7.通過查找命令找到社區版的安裝文件
yum search mysql
8.安裝mysql
yum install mysql-community-server.x86_64
9.開啟mysql服務
systemctl start mysqld
10.查看myqsl的默認密碼
cat /var/log/mysqld.log
2019-03-27T03:05:34.627566Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.15) initializing of server in progress as process 29114
2019-03-27T03:05:38.631106Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: I+w=67d;+ES8
2019-03-27T03:05:40.427422Z 0 [System] [MY-013170] [Server] /usr/sbin/mysqld (mysqld 8.0.15) initializing of server has completed
2019-03-27T03:05:42.371036Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.15) starting as process 29161
2019-03-27T03:05:43.074650Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-03-27T03:05:43.117341Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.15' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server - GPL.
2019-03-27T03:05:43.166968Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
11.使用密碼進行登陸mysql
mysql -uroot -p
12.修改設置密碼的驗證規則
set global validate_password.policy=0;
set global validate_password.length=1;
13.修改root的密碼
alter user 'root'@'localhost' identified by '新密碼';
14.退出后,使用新密碼登陸。查看數據庫。
mysql -u root -p
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
總結
以上是生活随笔為你收集整理的centeros6.8 mysql_centeros7安装mysql8,以及设置root密码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 特斯拉降价引海外热议:这是《孙子兵法》!
- 下一篇: 太爷爷去世 女子请假奔丧被老板怼:跟你啥