程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> MYSQL數據庫 >> MySQL綜合教程 >> rpm包形式安裝MySQL,rpm形式mysql

rpm包形式安裝MySQL,rpm形式mysql

編輯:MySQL綜合教程

rpm包形式安裝MySQL,rpm形式mysql


1、下載Mysql安裝所需的rpm包

http://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.linux_glibc2.5.x86_64.rpm

http://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.21-1.linux_glibc2.5.x86_64.rpm

http://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-devel-5.6.21-1.linux_glibc2.5.x86_64.rpm

 

2、安裝

[root@Luxh-01 softs]# rpm -ivh MySQL-server-5.6.21-1.linux_glibc2.5.x86_64.rpm 
[root@Luxh-01 softs]# rpm -ivh MySQL-client-5.6.21-1.linux_glibc2.5.x86_64.rpm
[root@Luxh-01 softs]# rpm -ivh MySQL-devel-5.6.21-1.linux_glibc2.5.x86_64.rpm

  安裝過程中,Mysql會成一個隨機密碼給root用戶,密碼存儲在 /root/.mysql_secret

  MySQL安裝目錄信息:

DirectoryContents of Directory /usr/bin Client programs and scripts /usr/sbin The mysqld server /var/lib/mysql Log files, databases /usr/share/info Manual in Info format /usr/share/man Unix manual pages /usr/include/mysql Include (header) files /usr/lib/mysql Libraries /usr/share/mysql Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for database installation /usr/share/sql-bench Benchmarks

 

3、啟動MySQL:

[root@Luxh-01 ~]# service mysql start
Starting MySQL...                                          [確定]
[root@Luxh-01 ~]# service mysql status
MySQL running (3270)                                       [確定]

 

4、登錄MySQL

[root@Luxh-01 ~]# mysql -uroot -p

  輸入安裝時生成的隨機密碼即可登入到MySQL的命令行界面

 

5、修改root用戶密碼

mysql> set password = password('123456');

 

6、復制/usr/share/mysql/my-default.cnf 到/etc/my.cnf

[root@Luxh-01 mysql]# pwd
/usr/share/mysql
[root@Luxh-01 mysql]# cp my-default.cnf /etc/my.cnf
[root@Luxh-01 mysql]# 

  然後根據實際需要可以修改/etc/my.cnf,修改後重啟mysql即可

 

7、允許root遠程登錄

mysql> grant all on *.* to root@'%' identified by "123456";
Query OK, 0 rows affected (0.02 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> 

 

 

  

 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved