问题解决:centos7下的 mysql

因为本人之前没有使用过centos,这回只是搭建一个centos的环境来测试我的站点,安装my的时候就遇到了很多问题,

1.安装mysql后发现启动不了:报如下错误

# systemctl start mysql Failed to issue method call: Unit mysql.service failed to load: No such file or directory.

# systemctl start mysql.service Failed to issue method call: Unit mysql.service failed to load: No such file or directory

# systemctl enable mysql.service Failed to issue method call: Access denied

最后发现是因为没有安装 mariadb-server 导致的,解决如下:

# yum install mariadb-server -y

# systemctl start mariadb.service

# systemctl enable mariadb.service

# mysql

Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 10 Server version: 5.5.44-MariaDB MariaDB Server Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

如何设置mysql root密码

# mysql_secure_installation,

然后随即的就是第二个问题,输入这些,它会让你输入root的密码,来确定,然后你才能修改密码,但是哥们装的时候你丫也没让我输入密码,这下完蛋了,解决的方法:

 

 

 

总结几个知识:

查看安装的服务(软件)

rpm –qa|grep -i mysql            -i 作用是不区分大小写

卸载服务(软件)

rpm –e 服务名称

转载于:https://my.oschina.net/handong9622/blog/745792

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值