CentOS安裝PHP和mysql

來源:互聯網
上載者:User

標籤:div   reset   nes   mysql   cgroup   string   hash   start   lin   

新生在不會編譯的情況下:

1、安裝PHP5

yum install php 根據提示輸入Y直到安裝完成 2、安裝PHP組件,使 PHP5 支援 MySQL yum install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt 2.安裝Mysql:**第一次安裝時出現: 

[[email protected]_18_87_centos ~]# service mysql start
Redirecting to /bin/systemctl start mysql.service
Failed to start mysql.service: Unit mysql.service failed to load: No such file or directory.

[[email protected]_18_87_centos mysql-5.5.3-m3]# service mysql status
Redirecting to /bin/systemctl status mysql.service
* mysql.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)

 

**在網上發現解決辦法:

sudo rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

 

**然後移除已安裝的Mysql後,再次安裝:

yum install  mysql mysql-server mysql-libs mysql-server

 

最後重啟Mysql服務:

 

[[email protected]_18_87_centos ~]# service mysql start
Redirecting to /bin/systemctl start mysql.service

 

可以啦:

[[email protected]_18_87_centos ~]# service mysql status
Redirecting to /bin/systemctl status mysql.service
* mysqld.service - MySQL Community Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2016-11-20 16:02:08 CST; 3s ago
Process: 16986 ExecStartPost=/usr/bin/mysql-systemd-start post (code=exited, status=0/SUCCESS)
Process: 16923 ExecStartPre=/usr/bin/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 16985 (mysqld_safe)
CGroup: /system.slice/mysqld.service
|-16985 /bin/sh /usr/bin/mysqld_safe
`-17139 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-...

Nov 20 16:02:07 VM_18_87_centos mysql-systemd-start[16923]: Support MySQL by buying s...
Nov 20 16:02:07 VM_18_87_centos mysql-systemd-start[16923]: Note: new default config ...
Nov 20 16:02:07 VM_18_87_centos mysql-systemd-start[16923]: Please make sure your con...
Nov 20 16:02:07 VM_18_87_centos mysql-systemd-start[16923]: WARNING: Default config f...
Nov 20 16:02:07 VM_18_87_centos mysql-systemd-start[16923]: This file will be read by...
Nov 20 16:02:07 VM_18_87_centos mysql-systemd-start[16923]: If you do not want to use...
Nov 20 16:02:07 VM_18_87_centos mysql-systemd-start[16923]: --defaults-file argument ...
Nov 20 16:02:07 VM_18_87_centos mysqld_safe[16985]: 161120 16:02:07 mysqld_safe Logg....
Nov 20 16:02:07 VM_18_87_centos mysqld_safe[16985]: 161120 16:02:07 mysqld_safe Star...l
Nov 20 16:02:08 VM_18_87_centos systemd[1]: Started MySQL Community Server.
Hint: Some lines were ellipsized, use -l to show in full.

 

 

 

CentOS安裝PHP和mysql

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.