一、修改口令
mysqladmin -u root password "newpass"
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
mysql> use mysql;
mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root';
mysql> FLUSH PRIVILEGES;
忘记root口令
#/opt/rh/root/usr/bin
scl enable mysql55 'mysqld_safe --skip-grant-tables'
# vi /etc/my.cnf
在[mysqld]的段中加上一句:skip-grant-tables
二、文件位置
/etc/my.cfg [mysqld] datadir
show variables like '%datadir';