标签:unit 启动失败 提示 http password sem code community pre
安装步骤安装前,我们可以检测系统是否自带安装 MySQL:
rpm -qa | grep mysql
如果你系统有安装,那可以选择进行卸载:
rpm -e mysql // 普通删除模式
rpm -e --nodeps mysql
安装
wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
rpm -ivh mysql57-community-release-el7-9.noarch.rpm
yum install mysql-server
初始化 MySQL:
mysqld --initialize
启动 MySQL:
systemctl start mysqld
查看 MySQL 运行状态:
systemctl status mysqld
$ systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: activating (start-pre) since 一 2018-09-03 06:27:17 EDT; 631ms ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 26472 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Control: 26489 (mysqld_pre_syst)
Memory: 26.6M
CGroup: /system.slice/mysqld.service
└─control
├─26489 /bin/bash /usr/bin/mysqld_pre_systemd
└─26506 /usr/bin/python -Es /usr/sbin/semanage fcontext -a -e /var/lib/mysql /var/lib/mysql-files
9月 03 06:27:17 test241vm22 systemd[1]: Starting MySQL Server...
chown mysql:mysql -R /var/lib/mysql
You must reset your password using ALTER USER statement before executing this statement.
安装完mysql 之后,登陆以后,不管运行任何命令,总是提示这个
step 1: SET PASSWORD = PASSWORD(‘your new password‘);
step 2: ALTER USER ‘root‘@‘localhost‘ PASSWORD EXPIRE NEVER;
step 3: flush privileges;
create user ‘test‘@‘10.1.3.200‘ identified by ‘123456‘;
grant all privileges on *.* to ‘sl_test‘@‘10.100.0.0‘;
flush privileges;
source /data/model/tables.sql
标签:unit 启动失败 提示 http password sem code community pre
原文地址:http://blog.51cto.com/12880687/2169839