How to Get MySQL and Redis Credentials
In some cases, you may want to directly access the MySQL or Redis services used by your WuWei platform. This guide shows you how to retrieve your database credentials and connect to the containers.
View MySQL & Redis Credentials
If you installed WuWei using the official installation script, your credentials are stored in the .env
file.
View the .env
file:
cat /root/wuwei-docker/.env
You will see entries like:
#mysql root password
MYSQL_ROOT_PASSWORD=your_root_password
#mysql database for wuwei
MYSQL_DATABASE=wuwei
#wuwei database user
MYSQL_USER=wuwei
#wuwei database password
MYSQL_PASSWORD=your_mysql_password
#redis password
REDIS_PASSWORD=your_redis_password
Connect to MySQL
Option 1: Enter the MySQL container manually
docker exec -it wuwei-mysql bash
Option 2: Use alias (if configured)
docker_mysql
Then connect to MySQL:
mysql -u {mysql_user} -p
Replace the {mysql_user}
and enter the password with the values from .env
file.
Connect to Redis
Option 1: Enter the Redis container manually
docker exec -it wuwei-redis bash
Option 2: Use alias (if configured)
docker_redis
Then connect using redis-cli
:
redis-cli
Authenticate with your Redis password:
auth {redis_password}
Replace redis_password
with the value found in your .env
file.