查询:
rpm -qa|grep mysql移除:
rpm -e mysql-libs-5.1.73-5.el6_6.x86_64 --nodeps
顺序安装如下rpm包:
rpm -i mysql-commercial-common-5.7.10-1.1.el6.x86_64.rpm
rpm -i mysql-commercial-libs-5.7.10-1.1.el6.x86_64.rpm
rpm -i mysql-commercial-client-5.7.10-1.1.el6.x86_64.rpm
rpm -i mysql-commercial-server-5.7.10-1.1.el6.x86_64.rpm
/usr/bin/mysqld --initialize --user=mysql
/etc/init.d/mysqld start或者直接
service mysqld start
问题:初始化或重启中可能会出现如下问题:
2016-01-31T13:47:52.934154Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation. 2016-01-31T13:47:52.934209Z 0 [ERROR] InnoDB: The error means mysqld does not have the access right s to the directory. 2016-01-31T13:47:52.934221Z 0 [ERROR] InnoDB: os_file_get_status() failed on './ibdata1'. Can't det ermine file permissions 2016-01-31T13:47:52.934232Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error 2016-01-31T13:47:53.539845Z 0 [ERROR] Plugin 'InnoDB' init function returned error. 2016-01-31T13:47:53.539899Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2016-01-31T13:47:53.539913Z 0 [ERROR] Failed to initialize plugins. 2016-01-31T13:47:53.539919Z 0 [ERROR] Aborting
遇到如上问题,你需要
vi /etc/selinux/config将
SELINUX=permissive
忘记root密码:(安全模式启动5.7同样有效)
mysqld_safe --skip-grant-tables --skip-networking &
mysql -uroot -p
重置密码:
use mysql;
update mysql.user set authentication_string=password('root') where user='root' and Host = 'localhost';
以上命令只适用于5.7版本的mysql哦!
第二次修改的时候需要这样子咯:
set password for 'root'@'localhost'=password('root');运行远程访问:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
FLUSH PRIVILEGES;
chkconfig --add mysqld chkconfig --level 2345 mysqld on
默认日志文件路径:/usr/log/mysqld.log
默认配置文件路径:/etc/my.conf
更多精彩内容请继续关注我的github主页:https://github.com/caicongyang