fedora 20 mysql 的安裝

從fedora 19以後,fedora將mysql 替換成了mariadb。這兩個東西雖然同源,但是個人還是喜歡mysql,而且不知道爲什麼,在fedora 20(64bit)下,安裝mariadb我只成功過一次,網上也完全找不到解決辦法。(有誰知道請不吝賜教,謝謝*^_^*)

下面是fedora 20 下面的安裝log

[root@rachel densintian]# yum -y install community-mysql-server #安裝數據庫
已加載插件:langpacks, refresh-packagekit
google-chrome                                                               3/3
正在解決依賴關係
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
--> 正在檢查事務
---> 軟件包 community-mysql-server.x86_64.0.5.5.35-1.fc20 將被 安裝
--> 正在處理依賴關係 community-mysql-common(x86-64) = 5.5.35-1.fc20,它被軟件包 community-mysql-server-5.5.35-1.fc20.x86_64 需要
--> 正在處理依賴關係 mysql(x86-64),它被軟件包 community-mysql-server-5.5.35-1.fc20.x86_64 需要
--> 正在檢查事務
---> 軟件包 community-mysql.x86_64.0.5.5.35-1.fc20 將被 安裝
---> 軟件包 community-mysql-common.x86_64.0.5.5.35-1.fc20 將被 安裝
--> 解決依賴關係完成

依賴關係解決

================================================================================
 Package                     架構        版本                源            大小
================================================================================
正在安裝:
 community-mysql-server      x86_64      5.5.35-1.fc20       updates      8.8 M
爲依賴而安裝:
 community-mysql             x86_64      5.5.35-1.fc20       updates      4.9 M
 community-mysql-common      x86_64      5.5.35-1.fc20       updates      208 k

事務概要
================================================================================
安裝  1 軟件包 (+2 依賴軟件包)

總下載量:14 M
安裝大小:78 M
Downloading packages:
(1/3): community-mysql-5.5.35-1.fc20.x86_64.rpm            | 4.9 MB   00:04     
(2/3): community-mysql-common-5.5.35-1.fc20.x86_64.rpm     | 208 kB   00:00     
(3/3): community-mysql-server-5.5.35-1.fc20.x86_64.rpm     | 8.8 MB   00:03     
--------------------------------------------------------------------------------
總計                                               1.4 MB/s |  14 MB  00:09     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安裝    : community-mysql-common-5.5.35-1.fc20.x86_64                 1/3 
  正在安裝    : community-mysql-5.5.35-1.fc20.x86_64                        2/3 
  正在安裝    : community-mysql-server-5.5.35-1.fc20.x86_64                 3/3 
  驗證中      : community-mysql-5.5.35-1.fc20.x86_64                        1/3 
  驗證中      : community-mysql-server-5.5.35-1.fc20.x86_64                 2/3 
  驗證中      : community-mysql-common-5.5.35-1.fc20.x86_64                 3/3 

已安裝:
  community-mysql-server.x86_64 0:5.5.35-1.fc20                                 

作爲依賴被安裝:
  community-mysql.x86_64 0:5.5.35-1.fc20                                        
  community-mysql-common.x86_64 0:5.5.35-1.fc20                                 

完畢!
[root@rachel densintian]# systemctl start mysqld.service
[root@rachel densintian]# systemctl enable mysqld.service
ln -s '/usr/lib/systemd/system/mysqld.service' '/etc/systemd/system/multi-user.target.wants/mysqld.service'
[root@rachel densintian]# mysql -u root  #以root登陸數據庫
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.35 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select user, host, password from mysql.user;   #user列表
+------+-----------+----------+
| user | host      | password |
+------+-----------+----------+
| root | localhost |          |
| root | rachel    |          |
| root | 127.0.0.1 |          |
| root | ::1       |          |
|      | localhost |          |
|      | rachel    |          |
+------+-----------+----------+
6 rows in set (0.00 sec)

mysql> delete from mysql.user where user=''; #刪除空user
Query OK, 2 rows affected (0.00 sec)

mysql> delete from mysql.user where user='root' and host='::1'; #刪除IPv6用戶(如果不用的話)
Query OK, 1 row affected (0.00 sec)

mysql> select user, host, password from mysql.user;
+------+-----------+----------+
| user | host      | password |
+------+-----------+----------+
| root | localhost |          |
| root | rachel    |          |
| root | 127.0.0.1 |          |
+------+-----------+----------+
3 rows in set (0.00 sec)

# 設定密碼
mysql> set password for root@localhost=password('XXXXXX');
Query OK, 0 rows affected (0.00 sec)

mysql> set password for root@rachel=password('XXXXXX');
Query OK, 0 rows affected (0.00 sec)

mysql> set password for root@'127.0.0.1'=password('XXXXXXX');
Query OK, 0 rows affected (0.00 sec)

#再次列密碼
mysql> select user, host, password from mysql.user;
+------+-----------+-------------------------------------------+
| user | host      | password                                  |
+------+-----------+-------------------------------------------+
| root | localhost | *C7E2F6338326EDC0AXXXXXXXXXXXXXXXXXXXXXXX |
| root | rachel    | *C7E2F6338326EDC0AXXXXXXXXXXXXXXXXXXXXXXX |
| root | 127.0.0.1 | *C7E2F6338326EDC0AXXXXXXXXXXXXXXXXXXXXXXX |
+------+-----------+-------------------------------------------+
3 rows in set (0.00 sec)

mysql> exit
Bye
[root@rachel densintian]# mysql -u root -p #再次登錄
Enter password:                            #輸入剛纔的密碼
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.35 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit
Bye
[root@rachel densintian]# 




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章