centos6.8 yum安装mysql 5.6

前端之家收集整理的这篇文章主要介绍了centos6.8 yum安装mysql 5.6前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

转载:http://blog.csdn.net/xiegh2014/article/details/72860951


  1. 一、检查系统是否安装其他版本的MysqL数据
  2. yumlistinstalled|grepMysqL
  3. yum-yremoveMysqL-libs.x86_64
  4.  
  5. 二、安装及配置
  6. wgethttp://repo.MysqL.com/MysqL-community-release-el6-5.noarch.rpm
  7. rpm-ivhMysqL-community-release-el6-5.noarch.rpm
  8. yumrepolistall|grepMysqL
  9. 1、安装MysqL数据库
  10. yuminstallMysqL-community-server-y
  11.  
  12. 2、设置为开机启动
  13. chkconfig--list|grepMysqLd
  14. chkconfigMysqLdon
  15.  
  16. 3、设置密码
  17. /usr/bin/MysqLadmin-urootpassword'123456'
  18.  
  19. 4修改root密码
  20. MysqL-uroot-p123456
  21.  
  22. MysqL>selectHost,User,PasswordfromuserwhereUser='root';
  23. +-----------------------+------+-------------------------------------------+
  24. |Host|User|Password|
  25. +-----------------------+------+-------------------------------------------+
  26. |localhost|root|*4A82FDF1D80BA7470BA2E17FEEFD5A53D5D3B762|
  27. |localhost.localdomain|root||
  28. |127.0.0.1|root||
  29. |::1|root||
  30. +-----------------------+------+-------------------------------------------+
  31. 4rowsinset(0.00sec)
  32.  
  33. MysqL>updateusersetPassword=password('123456')whereUser='root';
  34. QueryOK,4rowsaffected(0.03sec)
  35. Rowsmatched:4Changed:4Warnings:0
  36.  
  37. MysqL>selectHost,PasswordfromuserwhereUser='root';
  38. +-----------------------+------+-------------------------------------------+
  39. |Host|User|Password|
  40. +-----------------------+------+-------------------------------------------+
  41. |localhost|root|*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9|
  42. |localhost.localdomain|root|*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9|
  43. |127.0.0.1|root|*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9|
  44. |::1|root|*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9|
  45. +-----------------------+------+-------------------------------------------+
  46. 4rowsinset(0.00sec)
  47.  
  48. MysqL>flushprivileges;
  49. QueryOK,0rowsaffected(0.00sec)

猜你在找的CentOS相关文章