systemctl start mysqld.service systemctl status mysqld.service // mysql状态如下,红色标记为设置root密码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
mysql -u root -p // 输入自己设置的密码 [root@test1 ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 925 Server version: 5.6.49 MySQL Community Server (GPL)
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h'forhelp. Type '\c' to clear the current input statement.
#卸载老版本的libzip yum remove libzip #下载安装libzip-1.2.0 wget https://libzip.org/download/libzip-1.2.0.tar.gz tar -zxvf libzip-1.2.0.tar.gz cd libzip-1.2.0 ./configure make && make install
cp /data/redis-4.0.9/utils/redis_init_script /etc/init.d/redis vim /etc/init.d/redis
路径配置一下,注意:是6379.conf
1
/etc/init.d/redis start
测试是否开启成功
1
[root@test1 ~]# redis-cli -a "123456"
7. 安装redis扩展
1 2 3 4 5 6 7 8 9
yum -y install autoconf wget https://pecl.php.net/get/redis-5.3.1.tgz tar zxvf redis-5.3.1.tgz cd redis-5.3.1 /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config make make test make install
// 连接本地的 Redis 服务 $redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->auth('111111'); // 查看服务是否运行 echo"Server is running: " . $redis->ping()."\n";
1 2
[root@test1 data]# php redistest.php Server is running: 1
8. 安装swoole扩展
1 2 3 4 5 6 7
wget https://pecl.php.net/get/swoole-4.5.4.tgz tar zxvf swoole-4.5.4.tgz cd swoole-4.5.4 /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config make make install