redhat下安装mysql 5.6.20,解压zip包,查看已经安装过的mysql,卸载rpm安装包,安装mysql服务器端和客户端,修改mysql用户名,登陆mysql,启动关闭mysql
2? 我的電腦是Redhat 6.*版本,所以這里使用上面一個
3? 解壓zip包
4? 安裝以下幾個 rpm
MySQL-client-advanced-5.6.20-1.el6.x86_64.rpm
MySQL-server-advanced-5.6.20-1.el6.x86_64.rpm
5? 查看已經安裝過的mysql
rpm –aq | grep mysql
結果:
mysql-libs-5.1.66-2.el6_3.x86_64
mod_auth_mysql-3.0.0-11.el6_0.1.x86_64
mysql-connector-java-5.1.17-6.el6.noarch
mysql-test-5.1.66-2.el6_3.x86_64
mysql-devel-5.1.66-2.el6_3.x86_64
libdbi-dbd-mysql-0.8.3-5.1.el6.x86_64
qt-mysql-4.6.2-25.el6.x86_64(這個不用卸載)
rsyslog-mysql-5.8.10-6.el6.x86_64
mysql-bench-5.1.66-2.el6_3.x86_64
mysql-connector-odbc-5.1.5r1144-7.el6.x86_64
dovecot-mysql-2.0.9-5.el6.x86_64
php-mysql-5.3.3-22.el6.x86_64
mysql-5.1.66-2.el6_3.x86_64
mysql-server-5.1.66-2.el6_3.x86_64
說明上面這些Mysql相關的已經安裝了。
6 卸載上面安裝過的mysql
使用rpm –e mysql –nodeps –allmatches?(不理會依賴關系,刪除所有上一步查出來的相同的mysql)命令卸載上面不需要的mysql
例如:
rpm -e mysql-libs-5.1.66-2.el6_3.x86_64--nodeps –allmatches
按照相同的命令對安裝的其它mysql進行刪除。
7 將老版本的幾個文件手工刪除
[root@localhost mysql]# rm -f /etc/my.cnf
[root@localhost mysql]# rm -rf/var/lib/mysql
[root@localhost mysql]# rm -rf/var/share/mysql
[root@localhost mysql]# rm -rf/usr/bin/mysql*
[root@localhost mysql]#
8 安裝mysql服務器端
[root@localhost mysql]# rpm -ivhMySQL-server-advanced-5.6.20-1.el6.x86_64.rpm
Preparing...??????????????? ###########################################[100%]
??1:MySQL-server-advanced?########################################### [100%]
2014-10-12 15:22:30 0 [Warning] TIMESTAMPwith implicit DEFAULT value is deprecated. Please use--explicit_defaults_for_timestamp server option (see documentation for moredetails).
2014-10-12 15:22:30 6074 [Note] InnoDB:Using atomics to ref count buffer pool pages
2014-10-12 15:22:30 6074 [Note] InnoDB:Database physically writes the file full: wait...
2014-10-12 15:22:31 6074 [Note] InnoDB:Setting log file ./ib_logfile101 size to 48 MB
?
關于說明信息:
A RANDOM PASSWORD HAS BEEN SET FOR THEMySQL root USER !
You will find thatpassword in '/root/.mysql_secret'.
?
You must changethat password on your first connect,
no other statement but 'SET PASSWORD' willbe accepted.
See the manual for thesemantics of the 'password expired' flag.
?
Also, the account for theanonymous user has been removed.
?
In addition, you can run:
?
?/usr/bin/mysql_secure_installation
?
which will also give you the option ofremoving the test database.
This is strongly recommended for productionservers.
?
See the manual for more instructions.
?
Please report any problems athttp://bugs.mysql.com/
?
The latest information about MySQL isavailable on the web at
?
?http://www.mysql.com
?
Support MySQL by buying support/licenses athttp://shop.mysql.com
?
New default config file was created as/usr/my.cnf and
will be used by default by the server whenyou start it.
You may edit this file to change serversettings
?
9 安裝mysql 的客戶端
[root@localhost mysql]# rpm -ivhMySQL-client-advanced-5.6.20-1.el6.x86_64.rpm
Preparing...???????????????########################################### [100%]
??1:MySQL-client-advanced?########################################### [100%]
?
10 安裝MySQL-devel-advanced-5.6.20-1.el6.x86_64.rpm
[root@localhost mysql]# rpm -ivhMySQL-devel-advanced-5.6.20-1.el6.x86_64.rpm
Preparing...???????????????########################################### [100%]
??1:MySQL-devel-advanced??########################################### [100%]
[root@localhost mysql]#
?
11 修改mysql的密碼,第一次安裝的時候在,第一次安裝的時候的密碼文件在/root/.mysql_secret中
修改密碼:
[root@localhost ~]# pwd
/root
?
12 查看密碼:cat.mysql_secret
oracle收購Mysql后,新版的mysql剛安裝完mysql后不能直接輸入mysql登錄數據庫,而是設置了默認free password密碼,默認密碼放在了/root/.mysql_secret文件中,登陸后需要修改密碼.
?
13 ?修改密碼
A 啟動mysql
service mysql start
B 如果想關閉服務,命令是servicemysql stop
?
14 登錄服務器
mysql -u root -p
為用戶設置新密碼
set password=password('123456');
?
也可以使用腳本 /usr/bin/mysql_secure_installation進行交互式的修改mysql的root密碼
?
?
15.重新啟動一下redhat操作系統,然后再登陸(修改后再登陸發現登陸不了)
總結
以上是生活随笔為你收集整理的redhat下安装mysql 5.6.20,解压zip包,查看已经安装过的mysql,卸载rpm安装包,安装mysql服务器端和客户端,修改mysql用户名,登陆mysql,启动关闭mysql的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: etf期权开户条件
- 下一篇: 银行逾期记录怎么消除