lamp mysql 启动_CentOS7安装lamp详解,mysql 启动不了2002解决方案

1.更新yum源

2.安装Apahce, PHP, MySQL以及php连接mysql库组件。

#yum -y install httpd php53 mysql mysql-server php53-mysql

3.安装apache扩展:

#yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql

4.安装php扩展:

#yum install php53-cli php53-common php53-devel php53-gd php53-mbstring php53-soap php53-xml php53-xmlrpc php53-bcmath php53-snmp

5.安装mysql扩展:

#yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql

6.配置开机启动服务

#chkconfig httpd on [设置apache服务开机启动]

#chkconfig mysqld on [设置mysql服务开机启动]

#service httpd restart [启动httpd服务]

#service mysqld restart [启动mysqld服务]

【设置mysql的时候如报错,先莫慌】

7.安装zipunzip命令。

为了上传源码的方便和快速,一般会上传压缩包,所以安装zipunzip之后可以在线解压;

#yum install zip unzip

如有Mysql报错:CentOS安装mysql 的时候默认安装的是mariadb

我们再安装一下mariadb-server就好了

# yum install mariadb-server mariadb

mariadb数据库的相关命令是:

systemctl start mariadb  #启动MariaDB

systemctl stop mariadb  #停止MariaDB

systemctl restart mariadb  #重启MariaDB

systemctl enable mariadb  #设置开机启动

# systemctl start mariadb

然后正常启动mysql就好了

# mysql -u root -p

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值