转载:http://blog.csdn.net/xiegh2014/article/details/72860951
一、检查系统是否安装其他版本的MysqL数据 yumlistinstalled|grepMysqL yum-yremoveMysqL-libs.x86_64 二、安装及配置 wgethttp://repo.MysqL.com/MysqL-community-release-el6-5.noarch.rpm rpm-ivhMysqL-community-release-el6-5.noarch.rpm yumrepolistall|grepMysqL 1、安装MysqL数据库 yuminstallMysqL-community-server-y 2、设置为开机启动 chkconfig--list|grepMysqLd chkconfigMysqLdon 3、设置密码 /usr/bin/MysqLadmin-urootpassword'123456' 4、修改root密码 MysqL-uroot-p123456 MysqL>selectHost,User,PasswordfromuserwhereUser='root'; +-----------------------+------+-------------------------------------------+ |Host|User|Password| +-----------------------+------+-------------------------------------------+ |localhost|root|*4A82FDF1D80BA7470BA2E17FEEFD5A53D5D3B762| |localhost.localdomain|root|| |127.0.0.1|root|| |::1|root|| +-----------------------+------+-------------------------------------------+ 4rowsinset(0.00sec) MysqL>updateusersetPassword=password('123456')whereUser='root'; QueryOK,4rowsaffected(0.03sec) Rowsmatched:4Changed:4Warnings:0 MysqL>selectHost,PasswordfromuserwhereUser='root'; +-----------------------+------+-------------------------------------------+ |Host|User|Password| +-----------------------+------+-------------------------------------------+ |localhost|root|*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9| |localhost.localdomain|root|*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9| |127.0.0.1|root|*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9| |::1|root|*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9| +-----------------------+------+-------------------------------------------+ 4rowsinset(0.00sec) MysqL>flushprivileges; QueryOK,0rowsaffected(0.00sec)
原文地址:https://www.jb51.cc/centos/375377.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。