fedora28安装mysql(mariadb)

示例:安装mysql

1、查看是否安装mysql

Yum list installed mysql*

Rpm –qa | grep mysql*

Locate mysql*

2、查看yum源是否有mysql的安装包

Yum list mysql*

        

3、安装mysql客户端

Yum install mysql

        

4、安装mysql服务器端

Yum install mysql-server

5、安装mysql开发工具

Yum install mysql-devel

6、配置mysql字符集

/etc/my.cnf

Sudo gedit /etc/my.cnf

//最后一行添加 default –character-set = utf8

7、启动mysql服务

systemctl start mariadb.service  开启服务

systemctl stop mariadb.service 关闭服务

systemctl status mariadb.service 服务状态

systemctl restart mariadb.service 重启服务

添加一些配置:

文件/etc/my.cnf

在[mysql]中添加

         init_connect='SET collation_connection = utf8_unicode_ci'

init_connect='SET NAMES utf8' 

character-set-server=utf8 

collation-server=utf8_unicode_ci 

skip-character-set-client-handshake

文件/etc/my.cnf.d/client.cnf

在[client]中添加

default-character-set=utf8

文件/etc/my.cnf.d/mysql-clients.cnf

在[mysql]中添加

default-character-set=utf8

 

错误:

         Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.'

解决:

1、关闭selinux和防火墙

                  setenforce 0              关闭selinux

                  systemctl stop firewalld.service      关闭防火墙

2、检查配置/etc/my.cnf

3、查看日志:cat /var/log/mariadb/mariadb.log

 

错误:

# mysql -uroot -p

Enter password:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

//sudo mysqld_safe --skip-grant-tables &

解决:

systemctl stop mariadb.service      先关闭

使用进入安全模式:

mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

mysql -u root mysql

UPDATE user SET Password=PASSWORD('newpassword') where USER='root';

FLUSH PRIVILEGES;

Quit

 

systemctl stop mariadb.service

systemctl start mariadb.service

如果发现启动超时,查看下进程是否存在,存在kill

ps uaxww | grep -i mysql

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

姑苏 · 安阳

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值