1、首先下载wp-cli
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar chmod +x wp-cli.phar sudo mv wp-cli.phar /usr/local/bin/wp
2、安装Wordpress
$dbuser=dbuser $dbpass=dbpass $dbname=dbname mysql -u$dbuser -p$dbpass -e "create database $dbname DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;" ./wp --allow-root core download ./wp --allow-root core config --dbname=$dbname --dbuser=$dbuser --dbpass=$dbpass ./wp --allow-root core install --url=http://myurl.com/ --title="质控处" --admin_user=admin --admin_password=my_admin_password [email protected] chown -R www-data:www-data /opt/mydir
时间: 2024-10-14 10:13:10