#yum list installed | grep mysql
# yum -y remove mysql-libs.x86_64
#wget dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
#yum localinstall mysql-community-release-el6-5.noarch.rpm
# yum repolist all | grep mysql
# yum-config-manager --disable mysql55-community
# yum-config-manager --disable mysql56-community
# yum-config-manager --enable mysql57-community-dmr
# yum repolist enabled | grep mysql
# yum install mysql-community-server
#service mysqld start
# chkconfig --list | grep mysqld
# chkconfig mysqld on
# mysql_secure_installation
grep "password" /var/log/mysqld.log
mysql
set global validate_password_policy=0;
set global validate_password_length=4;
set password for 'xxxx'@'localhost'=password('xxxx');
flush privileges;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'xxx' WITH GRANT OPTION;
vi /etc/my.cnf
在[mysqld]的段中加上一句:skip-grant-tables
例如:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-grant-tables
保存并且退出vi。
service mysqld restart
update user set authentication_string=password('xxx') where user='root';
alter user 'root'@'localhost' identified by 'xxx';
[root@root ~]# /etc/init.d/mysqld start
Starting mysqld (via systemctl): Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
mkdir -p /var/run/mysqld/
chown mysql.mysql /var/run/mysqld/
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。