apache安装
yum -y install httpd php mysql mysql-server php-mysql
yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc
yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql
管理服务
systemctl start httpd
systemctl status httpd
systemctl stop httpd
开始安装mysql
rpm -ivh mysql57-community-release-el7-9.noarch.rpm
yum -y install mysql-server
vim /etc/my.cnf
在[mysqld]下新增一行:
skip-grant-tables
保存退出,并重启数据库服务
service restart mysqld
mysql -u root -p
回车 ,在mysql> 下执行以下语句,设置mysql的 root为123456
update mysql.user set authentication_string=password('123456') where user= 'root' ;
刷新内存
flush privileges;
退出数据库
exit
再次编辑/etc/my.cnf 文件
# vim /etc/my.cnf
#skip-grant-tables (#表示注释)
systemctl restart mysqld 重启数据库
mysql -u root -p
密码 123456
在mysql下执行以下语句,把root密码修改为NLHnhy123456!
alter user user() identified by "NLHnhy123456!";
exit
systemctl restart mysqld
mysql -u root -p
密码:NLHnhy123456!
show databases;
CREATE DATABASE IF NOT EXISTS blog default charset utf8 COLLATE utf8_general_ci; 创建名为 my_db 的数据库
解决wordprfess安装插件(升级主题)失败的问题:
1、在wp-config.php文件末尾加上
define('WP_TEMP_DIR', ABSPATH . 'wp-content/temp');
define("FS_METHOD","direct");
define("FS_CHMOD_DIR", 0777);
define("FS_CHMOD_FILE", 0777);
2、mkdir /var/www/html/wp-content/temp
3、chmod -R 777 /var/www/html