Database root account password and connection information
When using ServBay for database management, it is essential to know how to obtain and use the root account, password, and connection information for the database. This article will detail the root management account, passwords, and connection information for MySQL, MariaDB, PostgreSQL, MongoDB, and Redis that come with ServBay.
Obtaining the database root account password and connection information
The root account, password, and connection information for MySQL, MariaDB, and PostgreSQL databases can be found in the settings of the ServBay management panel. The steps are as follows:
- Open the ServBay management panel.
- Navigate to
Database
-MySQL
(or other database types you need to view). - Select the database version you want to view, such as
MySQL 8.4
. - On the right page, you can see the root username and password.
- Click the
eye
icon next to the password input box to view the root password.
On this page, you will be able to view the connection information for MySQL, MariaDB, and PostgreSQL, including username, password, host address, and port.
MySQL Database Default Connection Information
- Username: Obtained from the management panel, defaults to
root
- Password: Obtained from the management panel, defaults to
ServBay.dev
- Host Address:
localhost
- Port:
3306
(default port) - Socket:
/Applications/ServBay/tmp/mysql-<version>.sock
MariaDB Database Default Connection Information
- Username: Obtained from the management panel, defaults to
root
- Password: Obtained from the management panel, defaults to
ServBay.dev
- Host Address:
localhost
- Port:
3306
(default port) - Socket:
/Applications/ServBay/tmp/mariadb-<version>.sock
PostgreSQL Database Default Connection Information
- Username: Obtained from the management panel, defaults to the current user's username
- Password: Obtained from the management panel, defaults to
ServBay.dev
- Host Address:
localhost
- Port:
5432
(default port) - Socket:
/Applications/ServBay/tmp/.s.PGSQL.<port>
Redis Database Default Connection Information
- Host Address:
127.0.0.1
- Port:
6379
(default port) - Password: No password by default
Connecting using Socket Method
If the user chooses to connect to the database using the Socket method, ServBay provides the corresponding Socket file path.
MySQL Socket Connection
- Default Socket File:
/Applications/ServBay/tmp/mysql.sock
- MySQL Socket File:
/Applications/ServBay/tmp/mysql-server.sock
- Specific Version Socket File:
/Applications/ServBay/tmp/mysql-<version>.sock
Connection example:
mysql -u your_username -p -S /Applications/ServBay/tmp/mysql.sock
MariaDB Socket Connection
- Socket File:
/Applications/ServBay/tmp/mysql.sock
- MariaDB Socket File:
/Applications/ServBay/tmp/mariadb-server.sock
- Specific Version Socket File:
/Applications/ServBay/tmp/mariadb-<version>.sock
Connection example:
mysql -u your_username -p -S /Applications/ServBay/tmp/mysql.sock
PostgreSQL Socket Connection
- Socket File:
/Applications/ServBay/tmp/.s.PGSQL.5432
- Specific Port Socket File:
/Applications/ServBay/tmp/.s.PGSQL.<version>
Connection example:
psql -U your_username -h /Applications/ServBay/tmp -d your_database
Example Connection Commands
Here are some example commands for connecting to the MySQL, MariaDB, PostgreSQL, and Redis databases that come with ServBay.
Connecting to MySQL
Using TCP/IP Connection:
bashmysql -u your_username -p -h localhost -P 3306
1Using Socket Connection:
bashmysql -u your_username -p -S /Applications/ServBay/tmp/mysql.sock
1
Connecting to MariaDB
Using TCP/IP Connection:
bashmysql -u your_username -p -h localhost -P 3306
1Using Socket Connection:
bashmysql -u your_username -p -S /Applications/ServBay/tmp/mysql.sock
1
Connecting to PostgreSQL
Using TCP/IP Connection:
bashpsql -U your_username -h localhost -d your_database -p 5432
1Using Socket Connection:
bashpsql -U your_username -h /Applications/ServBay/tmp -d your_database
1
Connecting to Redis
Using TCP/IP Connection:
bashredis-cli -h 127.0.0.1 -p 6379
1Using Socket Connection:
Currently, socket connection to Redis is not supported.
Summary
Understanding and obtaining the connection information for MySQL, MariaDB, PostgreSQL, and Redis that comes with ServBay is an important step in database management. Through the ServBay management panel, you can easily obtain the root username, password, and connection information for MySQL, MariaDB, and PostgreSQL. Redis defaults to no password and uses the default port. For socket connections, ServBay provides the corresponding Socket file paths for users to connect locally.